you need escape
select * from mytable
where mycol like '5\% off' escape '\';
For a version that works regardless of NO_BACKSLASH_ESCAPES mode, you can use a different character, like pipe:
select * from mytable
where mycol like '5|% off' escape '|';
More Related Contents:
- How do I escape reserved words used as column names? MySQL/Create Table
- How to escape apostrophe (‘) in MySql?
- What characters have to be escaped to prevent (My)SQL injections?
- How to escape apostrophe (a single quote) in MySql?
- How to allow fulltext searching with hyphens in the search query
- How to use IN & NOT IN same query [closed]
- SQL Print the name of all Employees together with the name of their supervisor
- Syntax error due to using a reserved word as a table or column name in MySQL
- Change MySQL default character set to UTF-8 in my.cnf?
- MySQL: Large VARCHAR vs. TEXT?
- MySQL offset infinite rows
- Multiple-column foreign key in MySQL?
- What is the question mark’s significance in MySQL at “WHERE column = ?”?
- How do write IF ELSE statement in a MySQL query
- mysql – making a mechanism similar to Oracle’s seqences
- Setting up foreign keys in phpMyAdmin?
- How to get an age from a D.O.B field in MySQL?
- Invalid default value for ‘dateAdded’
- Importing a CSV to MySQL with different date format
- MySQL: When is Flush Privileges in MySQL really needed?
- MySQL too long varchar truncation/error setting
- MySQL: update a field only if condition is met
- how to use DISTINCT ON with mysql using ActiveRecord
- use a variable for table name in mysql sproc
- How to create dummy variable columns for thousands of categories in Google BigQuery?
- Most efficient way to store IP Address in MySQL [duplicate]
- What is the best way to do incremental backups in MySQL?
- Update multiple rows with multiple ‘where’ clauses for each individual row
- WHERE datetime older than some time (eg. 15 minutes)
- Is there a way to use ON DUPLICATE KEY to Update all that I wanted to insert?