ROW_NUMBER()
का उपयोग करें :
SELECT s.id,s.tag,s.version FROM (
SELECT t.*,
ROW_NUMBER() OVER(PARTITION BY t.id ORDER BY t.version DESC) as rnk
FROM YourTable t) s
WHERE s.rnk = 1
ROW_NUMBER()
का उपयोग करें :
SELECT s.id,s.tag,s.version FROM (
SELECT t.*,
ROW_NUMBER() OVER(PARTITION BY t.id ORDER BY t.version DESC) as rnk
FROM YourTable t) s
WHERE s.rnk = 1