Skip to content
Advertisement

Retrieve rows in which a column doesn’t contain a value

I have a MySQL table like below:

I want to retrieve all the rows in which userIDs doesn’t contain 1. I tried

But it’s not working.

Advertisement

Answer

Use FIND_IN_SET

But actually you should rather change your table design. Never store multiple values in a single column!

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement