MySql , Select with special Character

Viewed 38

so i have a table with this data, but when i query "select * from assetprofile WHERE description1='(1) GENSET\FOR ATM' ", it shows nothing . any help?

enter image description here

3 Answers

Try use IN operator:

SELECT * from assetprofile WHERE description1 IN ('(1) GENSET\FOR ATM')

The sample data does not have a space between the parentheses and GET, but your query does.

Try to escape the string using QUOTE function:

SELECT * FROM assetprofile WHERE description1 = QUOTE('(1) GENSET\FOR ATM'); 
Related