SELECT DISTINCT name, MAX(id) FROM tbl_student GROUP BY name ORDER BY MAX(id) DESC, name
SELECT DISTINCT name , row_number() OVER (PARTITION BY name ORDER BY id DESC) AS [rank] FROM tbl_student
SELECT DISTINCT name , row_number() OVER (PARTITION BY name ORDER BY id DESC) AS [rank] FROM tbl_student
No comments:
Post a Comment