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

Joshua Olson joshua at waetech.com
Thu Apr 8 21:11:04 CDT 2004


> -----Original Message-----
> From: Mike
> Sent: Thursday, April 08, 2004 3:10 PM

> How could a MySQL query look like, that selects all users that don't
> start with a, b, c... z?
>
> $query = "select * from otn_user where
> user ! like 'a%'
> user ! like 'b%' and
> user ! like 'c%' and
> .
> .
> .
> user ! like 'z%'
> order by user";
>
> ... throws an error :-/

Mike,

Not an MySQL guru, but (without the specific error text this is tough)
perhaps the logical operator is out of order?

user NOT LIKE 'z%'
! user LIKE 'z%'

??

<><><><><><><><><><>
Joshua Olson
Web Application Engineer
WAE Tech Inc.
http://www.waetech.com/service_areas/
706.210.0168




More information about the thelist mailing list