Reputation: 86
I want to search records based on my erp_no
my erp_no
field is varchar in my table.
I am using the following query to search
SELECT * FROM `invoice` WHERE erp_no LIKE '%SORD\WH03\17\0002917%'
But it's returning the empty result set may I know what is the issue?
Upvotes: 1
Views: 41
Reputation: 133370
You could use escaping sequence for backslash
SELECT * FROM `invoice` WHERE erp_no LIKE '%SORD\\WH03\\17\\0002917%'
looking to your sample you should use
SELECT * FROM `invoice` WHERE erp_no ='SORD\\WH03\\17\\0002917'
Upvotes: 2