find only certain attributes?

Is it possible to get find() to only return certain fields?

This would be helpful.

p.s.

I started writing a long post on why I "needed" find() to have an argument defining which fields to retrieve but erased it because I realized there are like 3 solutions to my problem, and adding an argument to save() to specify which fields are returned is just one of them.

In CDbCriteria, you can specify "select" argument to select which columns to return. It defaults to '*', meaning all columns.

Ah I guess I missed that.  Thanks!

Is there a way to select * and some extra columns without enumerating them all in ‘select’ parameter

of scopes or relations definition?

Something like


'select'=>array('*','concat_ws("field_1","field_2") as extra_col')

New topic started

http://www.yiiframework.com/forum/index.php?/topic/3776-find-and-some-additinal-columns/