0

这是桌子

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);

但它不起作用。

4

1 回答 1

2
SELECT STUDENT.School_ID
FROM STUDENT
WHERE STUDENT.st_phone IS NULL OR STUDENT.st_phone = ''

还是我误解了你的问题?

于 2013-03-21T20:48:46.800 回答