+ 1

How do I search underscore character in a given column?

3rd Sep 2016, 12:30 PM
Kirtiranjan Sahoo
Kirtiranjan Sahoo - avatar
3 Answers
+ 2
You need to escape the underscore, to treat it as a character and not a search wildcard. SELECT column FROM table WHERE column LIKE '%\_%' ESCAPE '\';
4th Sep 2016, 8:20 PM
Michael Skae
Michael Skae - avatar
0
Thanks
5th Sep 2016, 5:22 AM
Kirtiranjan Sahoo
Kirtiranjan Sahoo - avatar
0
Or with regular expression in the where clause, e.g.: select * from table where column_name REGEXP '.*\_.*';
10th Sep 2016, 4:35 PM
Stephan Borsodi
Stephan Borsodi - avatar