Id ItemId Item 1 1 Dog 2 1 Dog1 3 2 Cat 4 2 Cat1 5 3 Lion 6 3 Lion1
Id ItemId Item 2 1 Dog1 4 2 Cat1 6 3 Lion1
SELECT t1.ID, t1.ITEMID, t2.ITEM FROM ( SELECT MAX(ID) ID, ITEMID FROM A GROUP BY ITEMID ) AS t1 INNER JOIN A AS t2 ON t1.ID = t2.ID
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)