Would anybody be able to post an example of using 'AS' in a CDbCriteria statement? I've been looking all over the documentation, and can't figure out how to give CDbCriteria an alias.
$cdbcriteria = array( 'select'=>'id, name, city, state, smallsum, price, url, cat1, cat2, cat3, cat4, lat, lng', 'alias'=>'(3959*acos(cos(radians(:baselat)) * cos(radians(lat))*cos(radians(lng)-radians(:baselng))+sin(radians(:baselat))*sin(radians(lat)))) AS distance', 'order'=>'distance', 'condition'=>'cat1 = :venue OR cat2 = :venue OR cat3 = :venue OR cat4 = :venue', 'having'=>'distance <= :rnge', 'params'=>array(':baselat'=>$criteria['baselat'], ':baselng'=>$criteria['baselng'], ':venue'=>$criteria['venue'], ':rnge'=>$criteria['rnge']));
That's the last thing I tried (and it didn't work).