Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
database system
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
20 Sep 2012 at 14:01 UTC
Updated:
23 Oct 2013 at 13:39 UTC
i tried this
$q_obj->addExpression('IF(b.uid1<>:f,b.uid1,b.uid2)', 'to', array(':f'=>3));
but it gives error , despite the fact that this is the correct SQL query.
(SELECT id as id, IFNULL(c.uid1<>3,'c.uid1') as uid FROM table1 AS c WHERE c.id = 28)
Comments
Comment #1
pasqualleaddExpression() with IF statement example. Returns node status for page type, return node title otherwise: