Can we use sql functions like MAX() MIN() for magento collection rather than the query mentioned in this post ?

How To Get Min & Max Attribute Values From Database to Link to Price Slider


you can use it like below.

$collection = Mage::getModel('modulename/modulename')->getCollection(); 

    ->columns('MAX(your_index) as max_aliases');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.