Code Name Description Date
17-0001 A 01-AOE 02/01/2017
17-0001 A 02-AOE 02/02/2017
17-0001 B 01-AOE 02/01/2017
17-0001 B 02-AOE 02/03/2017
etc ...
我想选择不同的结果将是这样的:
Code Name Date
17-0001 A 02/01/2017 ---> Only The First Date And Not Show The Fld Desc
17-0001 B 02/01/2017
etc ...
感谢' s谁回答了我的问题。
答案 0 :(得分:3)
如果我理解正确,您需要在日期列中group by
和min
select code, name, min(date)
from t
group by code, name;
答案 1 :(得分:0)
检查一下。
select code, name, min(date) as date
from tablename
group by code, name;