Q: 有個table名叫person, has 4 fields, ID, Sales, Date, Rank
For example:
ID Sales Date Rank
10 10000 1/1 0
10 20182 1/2 1
20 10000 1/1 0
20 29765 1/2 1
20 23456 1/3 1
Now, for each unique ID, I want to select the highest rank, if there are two rows with equally highest rank, randomly select one.
The result table looks like
ID Sales Date Rank
10 20182 1/2 1
20 29765 1/2 1
OR
ID Sales Date Rank
10 20182 1/2 1
20 23456 1/3 1
叩謝!