Include column name when updating record

Hello all,

I use updateAll() to update records

$scc = $sccValue / count($model);




		'cost'=>'cost - ' .$scc,



	'bid_id = :bid_id', 





but the generated SQL become something like this (binding parameters are omitted):

UPDATE bid_detail SET cost=’cost-10’ WHERE …

which produces incorrect result. I expect it can be like this:

UPDATE bid_detail SET cost=cost-10 WHERE …

How can this be achieved if we want to use updateAll()?

Thank you in advance.

CDbExpression is what you need.


	array('cost' => new CDbExpression('cost - ' . $scc))


Works great. Thanks for the quick reply, phtamas.