select * from person
where (ID, rank) in
(select ID, max(rank) from person group by ID)
and rownum<=1
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.
•
Thank you!
-fafa_dd-
♀
(0 bytes)
()
03/16/2009 postreply
19:24:06
•
我本來是想用self join的,但我對這個不熟,總搞錯
-fafa_dd-
♀
(0 bytes)
()
03/16/2009 postreply
19:34:01