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 '%'
jking1234Asked:
Who is Participating?
 
awking00Connect With a Mentor Commented:
where field not like '\%%' escape '\'
0
 
Dale FyeCommented:
Does

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

work.
0
 
awking00Commented:
Missed the starting wildcard character -
where field not like '%\%%' escape '\'
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
Dale FyeCommented:
my expertise is Access, and that syntax would work in Access

WHERE [Field1] NOT LIKE "*[*]*"
0
 
jking1234Author Commented:
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'
0
 
awking00Commented:
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?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.