B-219 Sec-55 Noida, India
+918010221733

Magento – Group by collection in magento

You can try this:

$collection->getSelect()->distinct(true);
But this will retrieve distinct values based on id. If you want to retrieve videos using distinct video values, you should group by “value”.

$collection->getSelect()->group(‘value’);
If you want to debug the query executed :

$collection->getSelect()->__toString();

Hope this helps 🙂

(Visited 104 times, 1 visits today)

Leave a reply

You must be logged in to post a comment.