欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

查询[LIKE]SqlServer特殊字符

程序员文章站 2022-05-13 13:25:49
...

http://www.dqhxz.com/Post_572.html 如 SELECT @EmailTitle = REPLACE(@EmailTitle,' [ ',' [[] ') --1 SELECT @EmailTitle = REPLACE(@EmailTitle,' % ',' [%] ') --2 SELECT @EmailTitle = REPLACE(@EmailTitle,' _ ',' [_] ') --3 SELECT @EmailTitle =

查询[LIKE]SqlServer特殊字符

http://www.dqhxz.com/Post_572.html


SELECT @EmailTitle = REPLACE(@EmailTitle,'[','[[]')--1
SELECT @EmailTitle = REPLACE(@EmailTitle,'%','[%]')--2
SELECT @EmailTitle = REPLACE(@EmailTitle,'_','[_]')--3
SELECT @EmailTitle = REPLACE(@EmailTitle,'^','[^]')--4