[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1356
  • Last Modified:

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 '%'
0
jking1234
Asked:
jking1234
  • 3
  • 2
1 Solution
 
Dale FyeCommented:
Does

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

work.
0
 
awking00Commented:
where field not like '\%%' escape '\'
0
 
awking00Commented:
Missed the starting wildcard character -
where field not like '%\%%' escape '\'
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
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

Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now