查询所有月薪不是3000与5000的员工的信息,为什么下面的写法不对?
select * from emp where sal <> any(3000,5000); --查询不对select * from emp where sal not in(3000,5000); ---这可以
查询月薪是3000与5000的员工的信息。
select * from emp where sal =any(3000,5000); ---这可以
查询所有月薪不是3000与5000的员工的信息。
select * from emp where sal !=any(3000,5000); ----这错误 ,为什么?
select * from emp where sal <> any(3000,5000); --查询不对select * from emp where sal not in(3000,5000); ---这可以
查询月薪是3000与5000的员工的信息。
select * from emp where sal =any(3000,5000); ---这可以
查询所有月薪不是3000与5000的员工的信息。
select * from emp where sal !=any(3000,5000); ----这错误 ,为什么?
解决方案 »
- oracle 数据并发问题
- 查询表中Route这个字段的整列中数据是否有符合where Route = '路由2';前面怎么写?
- 从数据库里查询交易记录被修改的资料
- 求助 。。。帮忙看下有啥问题。。。。。。
- 如何在oracle 客户端的command窗口运行SQL语句
- 异常的异常处理
- 带输出游标参数的存储过程调用两个带输出游标参数的存储过程,怎么写
- 在oracle中怎么查询某一列为空或非空的所有记录?
- 关于 对两张表进行如下两种操作 高手请进 !急???
- 两个关于FOXBASE2。1的问题(急!急!急!)
- Oracle 11g R2客户端与服务器端在同一台机器,无法配置监听
- 数据库系统概念里的多码索引的问题,真心不懂,求大家帮帮忙.....
如果你這樣寫
select * from emp where sal !=any(5000);
則5000的就被排除掉了,明白了?
--=用any <>用all
select * from emp where sal<> all(3000,5000);
--=用any <>用all
select * from emp where sal<> all(3000,5000);
正解
any,all,in很常用