我得到了一个正确的结果,但现在不是向我显示结果 0 我希望他们向我显示 null 结果。我怎样才能得到结果 null 而不是 0 ?
SELECT w.FIRST_NAME,w.LAST_NAME,COUNT(s.SECTION_ID) AS COUNTED_SECTIONS
FROM INSTRUCTOR w LEFT OUTER JOIN SECTION s
ON w.INSTRUCTOR_ID = s.INSTRUCTOR_ID
GROUP BY w.FIRST_NAME,w.LAST_NAME
ORDER BY w.LAST_NAME;
当前显示
FIRST_NAME LAST_NAME COUNTED_SECTIONS
------------------------- ------------------------- ----------------
Rick Chow 0
Marilyn Frantzen 10
Fernand Hanks 9
Charles Lowry 0
etc
但我想要
FIRST_NAME LAST_NAME COUNTED_SECTIONS
------------------------- ------------------------- ----------------
Rick Chow
Marilyn Frantzen 10
Fernand Hanks 9
Charles Lowry
etc
我用 NVL 试过了,还是不行
NVL(COUNT(s.SECTION_ID),NULL) AS COUNTED_SECTIONS