oracle sql查询时间戳介于两个时间戳之间的记录 [英] oracle sql query for records with timestamp that falls between two timestamps
本文介绍了oracle sql查询时间戳介于两个时间戳之间的记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有两个时间戳,分别是字符串格式2015-05-06T15:39:00
和2015-04-06T15:39:00
.
I have two timestamps in String format 2015-05-06T15:39:00
and 2015-04-06T15:39:00
.
什么是Oracle的SQL查询,我可以查询表中时间戳在此范围内的所有记录.
What is the sql query for Oracle that I can query all the records in the table that has timestamp that falls within this range.
推荐答案
并通过其他方式可以在两者之间使用
And with alternative way you can use between
SELECT *
FROM tab1
WHERE timestamps BETWEEN TO_DATE ('2015-05-06T15:39:00', 'YYYY-MM-DD"T"HH24:MI:SS') AND TO_DATE('2015-04-06T15:39:00', 'YYYY-MM-DD"T"HH24:MI:SS');
这篇关于oracle sql查询时间戳介于两个时间戳之间的记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文