e***7 发帖数: 862 | 1 My data like
ID KEY
1 112
1 112
1 123
1 123
2 545
2 666
How could I select the min of key for each ID so my final data will look
like”
ID KEY
1 112
1 112
2 545
I don’t have an easy way to do it in proc sql, so any input will be
appreciated! | k*******a 发帖数: 772 | 2 try this:
select ID, KEY
from data
group by ID
where KEY = min(KEY) | e***7 发帖数: 862 | 3 I changed where to have and it worked, thanks!
【在 k*******a 的大作中提到】 : try this: : select ID, KEY : from data : group by ID : where KEY = min(KEY)
|
|