例如:
搜索条件是1234
数据库存的内容是 123 456
如果使用
select * from table where name like '%1234%'
是查不到数据的
如果要忽略 数据库字段中的空格 则可以使用 replace函数
select * from table where REPLACe(name,' ','') like '%1234%'
REPLACE同时还支持嵌套 例如还要将中文逗号替换成英文逗号
select * from table where REPLACe ( REPLACE(name,' ','') , ',' , ',') like '%1234%'
同时REPLACE 函数也支持使用在select 查询出的字段上
例如可以将查询出的数据中的空格给去掉
select REPLACE(name,' ','') AS name from table where REPLACE ( REPLACE(name,' ','') , ',' , ',') like '%1234%'



