Solved

MySQL select record where field does not contain % character

Posted on 2014-01-02
6
1,216 Views
Last Modified: 2014-02-06
I have a table where field 1 is a varchar. I want to select records where field 1 does not contain the character '%'
0
Comment
Question by:jking1234
  • 3
  • 2
6 Comments
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
Comment Utility
Does

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

work.
0
 
LVL 31

Accepted Solution

by:
awking00 earned 250 total points
Comment Utility
where field not like '\%%' escape '\'
0
 
LVL 31

Expert Comment

by:awking00
Comment Utility
Missed the starting wildcard character -
where field not like '%\%%' escape '\'
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
Comment Utility
my expertise is Access, and that syntax would work in Access

WHERE [Field1] NOT LIKE "*[*]*"
0
 

Author Comment

by:jking1234
Comment Utility
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
 
LVL 31

Expert Comment

by:awking00
Comment Utility
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

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

I have been using r1soft Continuous Data Protection (http://www.r1soft.com/linux-cdp/) for many years now with the mySQL Addon and wanted to share a trick I have used several times. For those of us that don't have the luxury of using all transact…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now