6,129
社区成员
发帖
与我相关
我的任务
分享
with A(code,t_time) as (
select '5028548010003','2015/12/2 19:07' union
select '5028548010003','2015/12/2 20:07' union
select '5028548010003','2015/12/2 19:31' union
select '5028548010006','2015/12/2 18:50' union
select '5028548010006','2015/12/5 10:45' union
select '5028548010007','2015/12/2 19:27' union
select '5028548010007','2015/12/4 13:09' union
select '502854801000B','2015/12/3 16:10' union
select '502854801000B','2015/12/4 13:24'
)
select a.code,min(t_time) t_min ,max(t_time) t_max from a group BY a.code