一条SQL,为什么And不可以,但or可以,大家进来看看(100分)

T

testnet

Unregistered / Unconfirmed
GUEST, unregistred user!
select emp_no, first_name, last_name from employee where
emp_no >= :low_no or emp_no <= :high_no
通过
select emp_no, first_name, last_name from employee where
emp_no >= :low_no and emp_no <= :high_no
不能通过
 
加括号,
 
你说说怎么不可以,是没有结果么?还是语法错误?
 
and 是对的
 
我已经试过这样了
select emp_no, first_name, last_name from employee where
((EMP_NO <= :HIGH_NO) AND (EMP_NO>=:LOW_NO))
但还是不能,是在JB7的Query下用Test Query测试的。
 
我代入具体数字没问题,两个条件去掉其中一个也没问题。
 
呵呵,莫非是JDBC有问题? ,呵呵, 应该可以吧,
 
这样也可以
select emp_no, first_name, last_name from employee where
((EMP_NO <= :HIGH_NO) and (not EMP_NO>=:LOW_NO))
别说我在玩大家,我现在的确在被JB7玩。
 
我用的是如下的数据库,没有问题。
Driver:com.borland.datastore.jdbc.DataStoreDriver
URL:jdbc:borland:dslocal:C:/JBuilder7/samples/JDataStore/datastores/employee.jds
你的parameterRow设置对了没有?
 
多人接受答案了。
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
1K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
968
SUNSTONE的Delphi笔记
S
D
回复
0
查看
2K
DelphiTeacher的专栏
D
顶部