0

我有一个名为 callinfo 的表,它有如下记录。

call#         callstarted                  callended

 1        03-04-2013 12:04:28 pm       03-04-2013  01:37:07 pm
 2        03-04-2013 01:15:02 pm       03-04-2013  02:12:15 pm
 3        04-05-2013 11:45:01 am       04-05-2013  01:20:35 pm

如何在下午 1:00 到下午 1:15 之间从 callinfo 检索记录?

4

1 回答 1

0

假设它们是日期列:

select * 
from callinfo
where  callstarted>=to_date(to_char(callstarted,'DD-MON-YYYY')||' 13:00','DD-MON-YYYY HH24:MI')
and    callended<=to_date(to_char(callended,'DD-MON-YYYY')||' 13:15','DD-MON-YYYY HH24:MI')
于 2014-06-03T15:25:17.617 回答