xuan huyen > 21-11-18, 03:26 PM
ongke0711 > 21-11-18, 11:04 PM
SELECT
t1.ID,
t1.TongDiem,
COUNT(*) AS XepHang
FROM
Table1 AS t1
LEFT JOIN Table1 AS t2
ON t1.TongDiem < t2.TongDiem OR ((t1.TongDiem = t2.TongDiem) AND (t1.ID = t2.ID))
GROUP BY
t1.ID,
t1.TongDiem