怎么写这样的sql语句?查某个字段中是否有\号

来源:百度知道 编辑:UC知道 时间:2024/06/28 00:48:21
我这样写是不行的:
select filed_name from table_name where filed_name like '%\%';
用的是mysql

你上面的语句可以用啊。你试试下面的
select filed_name from table_name where charindex('\',filed_name)!=0

\为转义字符,要取得\需要加\,也就是两个\
select filed_name from table_name where filed_name like '%\\%'

不知道你什么数据库,所以你试试
select filed_name from table_name where filed_name like '%[\]%';

select filed_name from table_name where filed_name like "%\\\%"

sql server 2000可以
你是什么数据库?