Reputation: 33
What are the occupations that are NOT student, lawyer or educator? List them in descending alphabetical order?
SELECT Occupation
FROM Viewer
WHERE occupation NOT IN 'student,lawyer,educator'
ORDER BY occupation desc;
I keep getting an error. What am i doing wrong?
Upvotes: 3
Views: 157
Reputation: 837926
IN
requires a list of expressions surrounded by parentheses:
SELECT Occupation
FROM Viewer
WHERE occupation NOT IN ('student','lawyer','educator')
ORDER BY occupation desc;
See the documentation for IN
to see the correct syntax:
Upvotes: 6