3

哪些职业不是学生、律师或教育工作者?按字母降序排列?

SELECT Occupation 
  FROM Viewer 
 WHERE occupation NOT IN 'student,lawyer,educator' 
ORDER BY occupation desc; 

我不断收到错误消息。我究竟做错了什么?

4

1 回答 1

6

IN需要括号括起来的表达式列表:

SELECT Occupation
FROM Viewer
WHERE occupation NOT IN ('student','lawyer','educator')
ORDER BY occupation desc;

请参阅文档IN以查看正确的语法:

在状态

于 2012-11-09T20:22:31.677 回答