当前位置: 代码迷 >> Sql Server >> 求一短小精罕,性能坡加的sql语句解决方案
  详细解决方案

求一短小精罕,性能坡加的sql语句解决方案

热度:65   发布时间:2016-04-27 16:52:17.0
求一短小精罕,性能坡加的sql语句
employeeid         serviceDate
1                           2004-01-01
1                           2008-01-01
1                           2006-01-01      
2                           2004-02-01
2                           2006-02-01
2                           2007-02-01

需要这个结果
employeeid         serviceDate
1                           2008-01-01
2                           2007-02-01


------解决方案--------------------
select employeeid,max(serviceDate) as serviceDate
from tablename
group by employeeid
  相关解决方案