select e.*, d.dname, c.cname from emp e, dept d, city c where ( e.deptno = d.deptno and d.loc = c.cid and sal > 2000 ) or ( e.deptno = d.deptno and d.loc = c.cid and comm is not null ) order by e.sal
SQL 99
1 2 3 4 5 6 7 8 9 10 11
select * from emp e inner join dept d on e.deptno = d.deptno inner join city c on d.loc = c.cid where e.sal > 2000 or e.comm is not null order by e.sal