to wjmmml(笑着悲伤) : 用Oracle 的 sqlPlus执行 您所写的语句时,显示的结果并不是 opcode !=300 的纪录,而是所有纪录,请问为什么?
SQL 里面的不等号用 <>
select * from table where opCode not in 300
在sqlplus里面 就要象 telenths(非法操作) 说的那样了 select * from table where opCode<>300或者 如楼上所说的select * from table where opCode not in (300)
若为Varchar的类型,最好是这样: select * from table where opCode <> '300'select * from table where opCode != '300'
那么,再请教一个难度深一点的问题: 表A userID opCode opName requireRight 求一sql,使该SQL执行的结果是 "select * from A where requireRight <=300 or opCode in (530,730,830)"的补集 ! 请不吝赐教!!
select * from A where userid not in (select userid from A where requireRight <=300 or opCode in (530,730,830) )假设userid为关键字。
select * from A where (requireRight>300) or (opCode not
to wjmmml(笑着悲伤) : 用Oracle 的 sqlPlus执行 您所写的语句时,显示的结果并不是
opcode !=300 的纪录,而是所有纪录,请问为什么?
select * from table where opCode<>300或者
如楼上所说的select * from table where opCode not in (300)
select * from table where opCode <> '300'select * from table where opCode != '300'
那么,再请教一个难度深一点的问题: 表A
userID opCode opName requireRight
求一sql,使该SQL执行的结果是
"select * from A where requireRight <=300 or opCode in
(530,730,830)"的补集 !
请不吝赐教!!
in (530,730,830));