【发布时间】:2016-05-01 03:37:41
【问题描述】:
在 sql server 中,我有一个查询:
SELECT * FROM [tableName] WHERE [colName] LIKE '%abc[xyz]%'。
同一个查询:
SELECT * FROM [tableName] WHERE [colName] LIKE '%abcx%' OR [colName] LIKE '%abcy%' OR [colName] LIKE '%abcz%'
在 C# 中,我使用 DataTable.SELECT("colName LIKE '%abc[xyz]%'") => 错误。
如何解决?
【问题讨论】:
-
你遇到了什么异常?
-
您的查询中不能有“[”或“]”。为什么不使用与第一个查询相同的 where 语句?