回複:聽說這裏有很多sql高手,有個簡單問題請教
Try this in Oracle:
select * from person
where (ID, rank) in
(select ID, max(rank) from person group by ID)
and rownum
But it's not random. Everytime when you select, the result should be the same.
You may need to add something "Randomly" select the row.