我有一个数据集(df1)
ID DATE
1 10-April-2013
2 11-April-2013
3 12-April-2013
1 12-April-2013
2 13-April-2013
4 16-April-2013
我需要获得1行/ ID报告最早的DATE
ID DATE
1 10-April-2013
2 11-April-2013
3 12-April-2013
4 16-April-2013
undf1 <- unique(df1[ ,c("ID","DATE")]) is not working since DATE is unique as well
我真的很感激这里有任何意见......
答案 0 :(得分:0)
SELECT DATE, MAX(id) FROM df1 GROUP BY DATE