# 一个 分组求最大值的有关问题 哪位哥哥姐姐帮忙看下 多谢了(2)

www.MyException.Cn  网友分享于：2013-02-28  浏览：36次

union all select '6925874512567 ', '2007-02-03 13:50:01.000 '
union all select '6902589647123 ', '2007-02-03 13:51:38.000 '
union all select '6914587562145 ', '2007-02-03 13:51:54.000 '
union all select '6901235897456 ', '2007-02-05 10:47:36.000 '
union all select '6901235897455 ', '2007-02-05 10:51:15.000 '
union all select '6920761200232 ', '2007-02-05 10:52:51.000 '
union all select '6921555581681 ', '2007-02-05 10:53:12.000 '
union all select '6921568974123 ', '2007-02-05 10:53:31.000 '
union all select '6921168555581 ', '2007-02-05 10:53:52.000 '
union all select '6904442000113 ', '2007-02-05 11:05:56.000 '
union all select '6905689456123 ', '2007-02-05 11:06:17.000 '
union all select '6905847568123 ', '2007-02-05 11:06:34.000 '
union all select '6902402030392 ', '2007-02-05 11:06:54.000 '
union all select '6917878000459 ', '2007-02-05 11:07:11.000 '
union all select '6914587562145 ', '2007-02-05 11:07:27.000 '
union all select '6904586785412 ', '2007-02-08 18:34:00.000 '
union all select '6904586785412 ', '2007-02-08 19:27:00.000 '
union all select '6904586785412 ', '2007-02-09 10:05:00.000 '
go
select * from t
---我现在想要 number 字段不重复 而且 只取重复记录中的最新时间的那一条 得出结果应该是
select number,max(cxtime) from t group by number order by number