0

comm が null でない場合、deptno と sal の両方に同時に参加する必要があります。私は次のことを思いつきました。ただし、deptno または sal のいずれかのみを受け入れます。同時に両方ではありません。

select ename,deptno,sal,comm from emp where deptno,sal in(select sal,deptno from emp where comm is not null);

これは自己結合です。

私はオラクル10gで試しています

前もって感謝します。

4

3 に答える 3

-1

あなたのクエリはこのようであってはなりません

select ename,deptno,sal,comm from emp where deptno,sal in(select deptno ,sal
from emp where comm is not null);
于 2013-06-05T15:09:22.570 に答える