数据仓库如何计算两者时间差了:
TD_TABLE:
pid time
123 00:01
123 00:02
123 00:03
123 00:04
select row_number() over(partition by time desc) as row_num from TD_TABLE
select t1.time-t2.time,t1.pid from TD_TABLE t1
join
扫描二维码关注公众号,回复:
1516827 查看本文章
TD_TABLE t2
on t1.pid=t2.pid and t1.row_num=t2.row_num-1