Gunakan fungsi ROW_NUMBER() dan klausa PARTITION BY. Sesuatu seperti ini:
SELECT Id, Name, Date FROM (
SELECT *, ROW_NUMBER() OVER (PARTITION BY Id ORDER BY Date desc) AS ROWNUM
FROM [MyTable]
) x WHERE ROWNUM = 1
Gunakan fungsi ROW_NUMBER() dan klausa PARTITION BY. Sesuatu seperti ini:
SELECT Id, Name, Date FROM (
SELECT *, ROW_NUMBER() OVER (PARTITION BY Id ORDER BY Date desc) AS ROWNUM
FROM [MyTable]
) x WHERE ROWNUM = 1