在表的列中搜索%符号 [英] Search % symbol in a column of a table

查看:66
本文介绍了在表的列中搜索%符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我的列包含一些记录中的特殊字符%....现在我想要一个SQl查询列出哪些记录包含%符号



注意:我需要一个查询,用 搜索运算符

Hello,
My column consists of a special character % in some of records.... Now i want an SQl query to list out the records which cotains % symbol

NOTE: I need a query which will be searched with like operator

推荐答案

尝试:

Try:
SELECT * FROM MyTable WHERE dataCol LIKE '%[%]%'


查询下方会给你所有名字中都有%字符的学生



Below Query will give you all students having % character in their name

select * from Student WHERE CHARINDEX('%',[Student Name],0)>1





希望这有帮助



Hope this helps


使用[%]



http://stackoverflow.com/questions/7191449/how-do-i-escape-a-percentage-sign-in-t-sql [ ^ ]



http://stackoverflow.com/questions/7736956/query-to-find-columns-that-end-with-percent-symbol [ ^ ]
Use [%]

http://stackoverflow.com/questions/7191449/how-do-i-escape-a-percentage-sign-in-t-sql[^]

http://stackoverflow.com/questions/7736956/query-to-find-columns-that-end-with-percent-symbol[^]


这篇关于在表的列中搜索%符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆