1

How do I construct the following query with DB API (so it's database engine independent):

SELECT 1 FROM DUAL

This example is for MySQL. I believe the Postgres version is

SELECT 1
0

1 Answer 1

0

You can try setting dual as the alias instead of the table.

$query = db_select(NULL, 'dual');
$query->addExpression('1');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.