爲什麼這給出一個空的結果?我試圖獲得不是監督員的一組員工的最小值,最大值和平均值。職員表的SQL聚合不產生結果
SELECT MIN(salary), MAX(salary), AVG(salary)
FROM employee
WHERE ssn NOT IN
(SELECT superssn FROM employee)
部分
SSN SUPERSSN
--------- ---------
888665555
333445555 888665555
987654321 888665555
987987987 987654321
123456789 333445555
999887777 987654321
666884444 333445555
453453453 333445555
什麼'select count(ssn)FROM employee WHERE ssn NOT IN(SELECT superssn FROM employee)'給你 – 2011-05-12 04:50:35