把92语法的sql改成99语法,怎么改?
--查询显示不存在员工的部门号
select d.deptno from emp e, dept d where e.deptno(+)= d.deptno group by d.deptno having count(e.empno)=0;
我这样改,报错了
select d.deptno from emp e join dept d right outer on(emp.deptno = dept.deptno) group by d.deptno having count(e.empno)=0;
怎么写呀???
------最佳解决方案-------------------- join dept d right
修改为
right join dept d right
如
select * from fudl_temp a right join fudl_fs b on a.a=b.dbname
------其他解决方案--------------------select d.deptno from emp e right join dept d on(emp.deptno = dept.deptno)
group by d.deptno
having count(e.empno)=0;
------其他解决方案--------------------如果你是看好老师的,我建议养成这样的书写习惯,也方便自己和别人调试.
select "d".deptno
from emp "e", dept "d"
where "e".deptno= "d".deptno
group by "d".deptno
having count("e".empno)=0;
select "d".deptno
from emp "e" join dept "d"
on("e".deptno = "d".deptno)
group by "d".deptno
having count("e".empno)=0;