2 years ago

#45344

test-img

sen

sql query to search string has special characters using mysql

I would like to know how to write sql query for search string that has special characters

I have table dlist with columns postalcode, block and floor and want to search like postalcode #block-floor pattern

Below is the search string type pattern I use

380100 #06-764 , 380100 06-764, 380100 6-764,
#06-764 380100 , 06-764 380100, 6-764 380100

Below is table and query tried

id block floor postalcode
1  6    764     380100
2  90    123     123456
3  2     457     456567
SELECT * FROM dlist WHERE 
CONCAT(postalcode, ' ',block,'-',floor) LIKE
'%380100 #06-764%';

mysql

select

replace

where-clause

sql-like

0 Answers

Your Answer

Accepted video resources