- 论坛徽章:
- 0
|
大家好!
我在做查询操作时,遇到个问题,请大家帮忙指点下
下面是我使用的查询语句:
select * from CC1ta01 where offinum="hngw1a" and tkgp in("112","114","113","115","100") and
((time >='20080214 19:00:00' and time <'20080214 20:00:00') or (time >='20080215 19:00:00' and time <'20080215 20:00:00'))
执行后长时间没有任何反映,没有结果也没有错误提示!
之后我把该语句的时间条件拆成下面两条语句分别执行,都有正确结果
select * from CC1ta01 where offinum="hngw1a" and tkgp in("112","114","113","115","100") and time >='20080214 19:00:00' and time <'20080214 20:00:00'
和
select * from CC1ta01 where offinum="hngw1a" and tkgp in("112","114","113","115","100") and time >='20080215 19:00:00' and time <'20080215 20:00:00'
然后执行下面的查询语句(使用union),也有结果:
select * from CC1ta01 where offinum="hngw1a" and tkgp in("112","114","113","115","100") and time >='20080214 19:00:00' and time <'20080214 20:00:00'
union
select * from CC1ta01 where offinum="hngw1a" and tkgp in("112","114","113","115","100") and time >='20080215 19:00:00' and time <'20080215 20:00:00'
我现在就是不明白上面的第一条查询语句为什么没有任何反应,我只是在时间条件上使用了(or)!
哪位能指点下吗 |
|