This is a product table and have few million of records.
I want to lis
Try this please:
SELECT * FROM YOURTABLE B JOIN (SELECT MAX(ID) MX FROM YOURTABLE GROUP BY STORE_ID) A ON A.STORE_ID = B.STORE_ID AND B.ID = A.MX GROUP BY B.STORE_ID ;