I need to join both deptno and sal same time when comm is not null. I came up with following. But it only accept either deptno or sal. not both in same time.
select ename,deptno,sal,comm from emp where deptno,sal in(select sal,deptno from emp where comm is not null);
This is a self join.
I am trying it on oracle 10g
Thanks in advance.