Link to home
Start Free TrialLog in
Avatar of jking1234
jking1234

asked on

MySQL select record where field does not contain % character

I have a table where field 1 is a varchar. I want to select records where field 1 does not contain the character '%'
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Does

WHERE [Field1] NOT LIKE '%[%]%'

work.
ASKER CERTIFIED SOLUTION
Avatar of awking00
awking00
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Missed the starting wildcard character -
where field not like '%\%%' escape '\'
my expertise is Access, and that syntax would work in Access

WHERE [Field1] NOT LIKE "*[*]*"
Avatar of jking1234
jking1234

ASKER

where field not like '%\%%' escape '\'  works ok in my test table but does not work on the real table where the field value is similar to

'%referer=%referer=%referer=%referer=Studiowallpaper.net'
Don't know why that shouldn't work. Can you provide some sample data for the field1 from your real table and what you would expect the output to be?