I have this mysql statement:
SELECT `review_userid` , `book_id` , `review_id` , `user_class` , COUNT( review_id )
FROM `booklist_books`
LEFT JOIN `booklist_reviews` ON booklist_books.book_id = booklist_reviews.review_bookid
LEFT JOIN `e107_user` ON booklist_reviews.review_userid = e107_user.user_id
WHERE '12' NOT IN (`user_class`)
GROUP BY `review_userid`
ORDER BY COUNT(`review_id`) DESC
LIMIT 0 , 100
user_class is a comma-delimited string (e.g: 1,2,3,4,5), as you can see below.
Using phpmyadmin, I get the following result:

Why do I get results that have ’12’ in the user_class field since I am using '12' NOT IN(... ??
If I can’t user user_class in the IN() operator, what is the alternative to this?
Thanks
INorNOT INis not working like that, check the function FIND_IN_SET