mysql - Retrieve rows in which a coloumn doesn't contain a value -


i have mysql table below:

| id |  userids   --------------- |  1 | 4,3,5    |  2 | 2,3 |  3 | 1,2,3 

i want retrieve rows in userids doesn't contain 1. tried

select * tablename  1 not in (userids) 

but not working. help?

use find_in_set

select * tablename   find_in_set(1, userids) = 0 

but should rather change table design. never store multiple values in single column!


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -