SQL中replace函数

string sql1 = "select price from dbo.eazy_farm where REPLACE(title,' ','')='" + cainame + "' and company_id='" + company_id.ToString() + "'";

replace第一个参数为数据库字段名

          第二个参数为被替换的字符

          第三个参数为需要替换成的字符

上面sql语句的意思是需要把title中的所有空格去掉然后和cainame比较

原文地址:https://www.cnblogs.com/yabisi/p/6046175.html