2
select deptno
from emp2
MINUS
select deptno
from dpt
order by deptno;
上述查询返回=无数据实测值SQL MINUS操作者
然而,
select deptno,ename
from emp2
MINUS
select deptno,dname
from dpt
order by deptno;
返回所有DEPTNO和ENAME字段值。
您能否解释为什么我会在第二个查询中使用MINUS运算符来获取deptno字段的所有值?
legend:
emp is employee table and dpt is department table,
ename is employee name -belonging to emp,
dname is department name -belonging to dpt,
deptno is department no. -common to both
非常感谢你,现在让我完全感觉:) –