17,086
社区成员
发帖
与我相关
我的任务
分享
insert /*+ append */ into t2
select a.卡号
,max(case when rn=1 then a.打卡时间 end)
,max(case when rn2 then a.打卡时间 end)
,max(case when rn=3 then a.打卡时间 end)
,max(case when rn=4 then a.打卡时间 end)
,max(case when rn=5 then a.打卡时间 end)
,max(case when rn=6 then a.打卡时间 end)
from
(select t1.*,row_number() over(partition by 卡号 ordeer by 打卡时间) rn
from t1
)a
group by a.卡号