select* from txt001_menu
as of timestamp (systimestamp - interval '300'minute)
wheremenuid = '060201' --查找txt001_menu表中300分钟之前的数据
>>>>select * from txt001_menu as of timestamp (systimestamp - interval'600' second) where menuid = '060201' --查找txt001_menu表中600秒之前的数据
>>>>select * from txt001_menu as of timestamp (systimestamp - interval '3'hour)
wheremenuid = '060201' --查找txt001_menu表中3小时之前的数据
>>>>select * from txt001_menu as of timestamp (systimestamp - interval '1'day)
wheremenuid = '060201' --查找txt001_menu表中1天之前的数据
——————————————————————————————————————————————
timestamp(ags) 方法
interval(时间间隔)类型用来存储两个时间戳之间的时间间隔
时间间隔类型interval请看下一篇文章:http://blog.sina.com.cn/s/blog_4b5bc01101011d76.html
本文详细介绍了如何使用SQL查询特定时间间隔前的数据,包括分钟、秒、小时和天的查询方法,通过使用timestamp和interval类型,实现高效的数据筛选。
1135

被折叠的 条评论
为什么被折叠?



