oracle 查询某个字段相同并且时间满足某个条件(重复)的数据

SELECT ID,JOB_NUMBER,CHECK_TIME,REPEAT_TIME,REPEAT_TIME2 FROM (
SELECT ID,JOB_NUMBER,CHECK_TIME,LAG(CHECK_TIME,1)OVER(PARTITION BY JOB_NUMBER ORDER BY CHECK_TIME asc) REPEAT_TIME,LAG(CHECK_TIME,1)OVER(PARTITION BY JOB_NUMBER ORDER BY CHECK_TIME DESC) REPEAT_TIME2 FROM "CK_TIME_RECORD"
)
where ((trunc(abs(CHECK_TIME - REPEAT_TIME) * 24 * 60 * 60 ) <= 30) AND (trunc(abs(CHECK_TIME - REPEAT_TIME) * 24 * 60 * 60 ) >0 ) ) or ((trunc(abs(CHECK_TIME - REPEAT_TIME2) * 24 * 60 * 6

oracle 查询某个字段相同并且时间满足某个条件(重复)的数据最先出现在Python成神之路

版权声明:
作者:congcong
链接:https://www.techfm.club/p/7277.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>