In yii, i have a CDbCriteria
with select property as:
$criteria->select = "IFNULL(t.cccid,'Default')";
That is I want to return 'Default' if t.cccid is NULL. Else value of t.cccid should be returned/
The problem is that IFNULL
is not being recognized. I get error as:
trying to select an invalid column "'Default')"
I have also tried:
$criteria->select = "IFNULL(t.cccid,'Default') as cccid";
and then i get syntax error.
Can anyone help me on how to use IFNULL
in $criteria->select
?