回复:听说这里有很多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.