这是表格
CREATE TABLE STUDENT
(
School_ID char(3),
St_LastName char(15),
St_FirstName char(15),
St_DOB char(15),
St_SS# char(15),
St_Address char(15),
St_City char(15),
St_State char(2),
st_Zip char(5),
st_phone char(15)
);
我必须写下查询:确定有多少学生没有电话。
我在ACCESS
中编写了以下查询SELECT STUDENT.School_ID
FROM STUDENT
WHERE STUDENT.st_phone NOT IN( SELECT STUDENT.st_phone, Count(STUDENT.st_phone) AS StudentWithNoPhone FROM STUDENT
GROUP BY STUDENT.st_phone);
但它不起作用。
答案 0 :(得分:2)
SELECT STUDENT.School_ID
FROM STUDENT
WHERE STUDENT.st_phone IS NULL OR STUDENT.st_phone = ''
或者我误解了你的问题?