Search This Blog

Monday, July 25, 2011

magento how to use distinct or get unique records from collection

magento how to use distinct or get unique records from collection

$collection = Mage::getModel('catalog/product')->getCollection()
->distinct(true)
->addAttributeToSelect('color')
->load();

No comments:

Post a Comment