I build a query with an alias field and need to include this alias field value inthe query condition.
$collection = Mage::getModel('customer/customer')->getCollection(); $collection->getSelect()->join(array('review'=>'flrating'),"e.entity_id = review.reviewed_user_id ",array('total_avg_rating'=>'AVG(review.avg_rating)')); $collection->getSelect()->having('e.total_avg_rating >= ?', $min)->having('e.total_avg_rating <= ?',$max); $collection->getSelect()->group('review.reviewed_user_id');
allies name is "total_avg_rating" but it shows error: "total_avg_rating not exist".
allies filed name result
As per follow your mention way