你看一下下面的 SQL,应该能说明问题:
[PHP]
select count(*) cnt from fm_alhistory aa, fm_alhistory bb
where aa.occur_Time between to_date('2007-11-24 14:43:00','yyyy-mm-dd hh24:mi:ss')
and to_date('2007-11-25 14:43:00','yyyy-mm-dd hh24:mi:ss')
and bb.occur_Time between to_date('2007-11-24 14:43:00','yyyy-mm-dd hh24:mi:ss')
and to_date('2007-11-25 14:43:00','yyyy-mm-dd hh24:mi:ss') ;
[/PHP]
与
[PHP]
select count(*) cnt from fm_alhistory aa, fm_alhistory bb
where aa.occur_Time between to_date('2007-11-24 14:43:00','yyyy-mm-dd hh24:mi:ss')
and to_date('2007-11-25 14:43:00','yyyy-mm-dd hh24:mi:ss')
and aa.occur_Time = bb.occur_Time ;
[/PHP] |