我正在使用这个查询:
SELECT ts as "TimeStamp",
stat as "Status"
FROM myTable
WHERE stat = 'O'
AND source = 'Source1'
AND ts BETWEEN TO_TIMESTAMP('2013-10-05','yyyy-mm-dd') AND
TO_TIMESTAMP('2013-10-06','yyyy-mm-dd')
并且还尝试过:
SELECT ts as "TimeStamp",
stat as "Status"
FROM myTable
WHERE stat = 'O'
AND source = 'Source1'
AND ts >= TO_TIMESTAMP('2013-10-05','yyyy-mm-dd') AND ts <
TO_TIMESTAMP('2013-10-06','yyyy-mm-dd')
它返回 0 条记录,但如果我这样做
SELECT ts as "TimeStamp",
stat as "Status"
FROM myTable
WHERE stat = 'O'
我可以清楚地识别出 5 条记录。显然TO_TIMESTAMP
工作不正常我希望有人能够帮助确定正确的修复
编辑:澄清一下,我只想要 10/5 的时间范围,不包括 10/6 抱歉粘贴了错误的结果而且该字段的类型为 TIMESTAMP(6)