आप उपयोग कर सकते हैं:
SELECT *
FROM (SELECT *, ROW_NUMBER() OVER(PARTITION BY id ORDER BY mia DESC) AS rn
FROM table) sub
WHERE rn = 2;
आप उपयोग कर सकते हैं:
SELECT *
FROM (SELECT *, ROW_NUMBER() OVER(PARTITION BY id ORDER BY mia DESC) AS rn
FROM table) sub
WHERE rn = 2;