设有关系表EMP(ENO,ENAME,SALARY,DNO),其中各属性的含义依次为职工号、姓名、工资和所在部门号,以及关系表DEPT(DNO,DNAME,MANAGER),其中各属性含义依次为部门号、部门名称、部门经理的职工号请用一句SQL语句将"销售部"的那些工资数额低于600的职工的工资上调10% update emp
set salary=(
select salary*1.1 from emp,dept
where emp.dno=dept.dno
and dname='销售部' and salary<600
)
where salary<600;提示错误,错在哪里?
set salary=(
select salary*1.1 from emp,dept
where emp.dno=dept.dno
and dname='销售部' and salary<600
)
where salary<600;提示错误,错在哪里?
解决方案 »
- oracle 数据转编码问题
- WIN7 64位如何裝ORACLE11G的ODBC驅動啊?
- 改了IP,OracleDBConsoleOrcl服务无法启动
- Oracle job错误
- Oracle 10g创建存储过程必须先创建包吗?
- ******为什么这个游标循环不起来!for in ....loop *******
- (200分)在jsp中,调用怎样的oracle的sql语句实现快速分页?是top还是rownum?最好给个例子????????????
- 请问在哪里写存储过程?在哪里执行?请给一个最简单的例子,不用带参数!
- oracle 的备份是的时间问题
- 关于WHERE条件等于空的问题,请帮忙,急~~~~
- 同一机器安装了Oracle服务端还要安装客户端吗?
- 新建的odbc连接oracle怎样测试呢?
where salary <600
and DNO in (select DNO from DEPT where dname='销售部')
set salary=salary*1.1
where emp.dno=dept.dno and dname='销售部' and salary <600
using dept
on(emp.dno=dept.dno and dept.dname='销售部')
when matched then
update set salary=salary * 1.1;
将:
on(emp.dno=dept.dno and dept.dname='销售部')
改为:
on(emp.dno=dept.dno and dept.dname='销售部' and emp.salary<=600)即可
set salary=(
select salary*1.1 from dept
where emp.dno=dept.dno
and dname='销售部' and salary <600
)
where salary <600;
这样可以吗