ActiveRecord: replace original column with calculated

Hi guys.

I need to replace column result by calculated value in several records. It is easy to do this in SQL:

SELECT IF(yesno IS NULL, 'no', yesno) AS  yesno

How to do this in Yii?

this works?


I am looking for a way to generate proper SQL queries for my case with ActiveRecord.

Active record is meant to be used on a per-record basis. If you’re looking for batch updates, use DAO or query builder.