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
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.
Sign up to join this communityYou can try setting dual as the alias instead of the table.
$query = db_select(NULL, 'dual');
$query->addExpression('1');