Reputation: 1
Can anyone help my find this syntax error?
SELECT `song`, COUNT(*)
FROM `2015_awards`
WHERE `song` IS NOT `NoVote`
GROUP BY `song`;
I'm trying to exclude NoVote songs, and it won't work. Everything else is fine. When I Google problems like this, it looks as though it should work.
Upvotes: 0
Views: 71
Reputation: 142
The IS
Keyword is only for NULL
comparisons.
As Pigasus says, you probably should be using <>
.
Hope this will solve your problem
Upvotes: 1
Reputation: 7240
You cant not use pass NoVote as a value to IS
or IS NOT
Try this:
SELECT song, COUNT(*) FROM 2015_awards WHERE song != 'NoVote' GROUP BY song;
Upvotes: 2