使用like运算符选择数据 [英] Select data using like operator
本文介绍了使用like运算符选择数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
如果表中存在的记录包含单引号和双引号,如何使用like运算符从数据库中检索记录.我需要一个查询.
谢谢
Hi all,
How to retrieve records from the database using like operator if the records present in the table contains single quotes and double quotes.I need a single query.
Thanks
推荐答案
尝试一下
Try This
SELECT * FROM dbo.Table WHERE Text LIKE '%''%' AND Text LIKE '%"%'
问候
AB Abulubbad
Regards
AB Abulubbad
尝试一下.
Try this.
SELECT * FROM tablename WHERE column_name LIKE '%''%' OR column_name LIKE '%"%'
您需要使用ESCAPE
You need to useESCAPE
WHERE c1 LIKE '%10-15!% off%' ESCAPE '!'
http://msdn.microsoft.com/en-us/library/ms179859.aspx [ ^ ]
http://msdn.microsoft.com/en-us/library/ms179859.aspx[^]
这篇关于使用like运算符选择数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文