CDbExpression usage

Besides using CDbExpression for getting current date time (i.e. new CDbExpression(‘NOW()’); ),

is there any other scenarios CDbExpression can be useful ?

Maybe to call any other database function? ;) Or to refer other table fields when using updateAll() for example…

$model->updateAll(array('field1'=>new CDbExpression('field2*RAND()+1')));


you can use this

hope it will be done.