[thelist] MySQL query: not like a, b, c,...

Tab Alleman Tab.Alleman at MetroGuide.com
Fri Apr 9 08:15:54 CDT 2004

> And this seems to be another logic, it gives no results (no error
> either): $query = "select * from otn_user where
> ! user like 'a%' and
> ! user like 'b%' and...

My proposed solution was going to be along these lines, but I would have
written out NOT, and used parens:

	NOT (user LIKE 'a%') AND
	NOT (user LIKE 'b%') AND...

Don't have MySQL to test it with though.

More information about the thelist mailing list