0

I've a column in my MySql database with values like this

firstname + ',' + surname

the character ' is part of the content.

I've to make a query to db like this:

SELECT * FROM UDERSCHEMA where EXPRESSION like 'firstname +  '','' + surname'

as you can see I tried to escape ' quoting it (with another '), but when I make the query on db result is empty set, I've to retrieve instead a set with one entry, how can I modify my query to correctly make MySql understand special characters as ' ?

4

1 回答 1

3

使用反斜杠转义特殊字符

回答:

\'

SQLFiddle 演示

于 2013-09-06T13:55:45.697 回答