Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8120177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:03:09+00:00 2026-06-06T05:03:09+00:00

I have this mysql statement: SELECT `review_userid` , `book_id` , `review_id` , `user_class` ,

  • 0

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:

mysql 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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T05:03:11+00:00Added an answer on June 6, 2026 at 5:03 am

    IN or NOT IN is not working like that, check the function FIND_IN_SET

    WHERE FIND_IN_SET('12', `user_class`) = 0
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this MySQL statement which works fine: SELECT claim_items.item_id, claim_items.quantity*items_rate.rate as per_item FROM
I have a simple MySQL select statement: SELECT COUNT(*) AS COUNT FROM MY_TABLE WHERE
If I have a MySQL statement like this: $sql=SELECT `name`, DATE(`time`), FROM `students` WHERE
i have this MySQL statement from a search page, the user enters there postcode
So, I have this mysql query: SELECT member_id, text FROM review WHERE text !=
I have this simple MySQL statement: SELECT ((AVG(q1) + AVG(q8) + AVG(q15)) / 3
I'm currently working with this MySQL statement: SELECT * FROM jobs GROUP BY jobType,
I have this mysql statement but I receive LIMIT in subquery error SELECT id
Looking to improve this mysql select statement for a search query: Select * from
I have this query to use in PHP: mysql_query(select count(*) from registeredUsers where email=.$_SESSION[username]);

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.