来自MSSQL的sql查询

问题描述:

当我有一行包含无法使用"的单词时,执行此sql查询时我得到的结果为零!

SELECT * FROM rccdb.dbo.SEARCH WHERE PROB_TITLE like''%Unable''


有谁知道解决方案吗?

i am getting zero results when executing this sql query while i have one row contains "Unable" word!!!


SELECT * FROM rccdb.dbo.SEARCH WHERE PROB_TITLE LIKE ''%Unable''


Does anyone knows the solution?

如果PROB_TITLE字段具有以"Unable"结尾的条目,则将返回结果.如果您要在字段中的任何位置查找无法使用"一词,则必须将规范更改为%Unable%".
This will return a result if the PROB_TITLE field has an entry that ends with "Unable". If you''re looking for the word "Unable" anywhere in the field, you''ll have to change your spec to ''%Unable%''.


Shadi,


使用这个-
SELECT * FROM rccdb.dbo.SEARCH WHERE PROB_TITLE like''%Unable%''

末尾的通配符(%)也有所不同.如果"Unable"字样在任何地方,它将带来结果.

谢谢
Srini Oleti.
Hi Shadi,


Use this -
SELECT * FROM rccdb.dbo.SEARCH WHERE PROB_TITLE LIKE ''%Unable%''

What is different is wild card (%) at the end also. It should bring result if "Unable" word is there any where.

Thank you,
Srini Oleti.


尝试SELECT * FROM rccdb.dbo.SEARCH WHERE PROB_TITLE = ''%Unable''


SELECT * FROM rccdb.dbo.SEARCH WHERE PROB_TITLE LIKE ''Unable''
Try SELECT * FROM rccdb.dbo.SEARCH WHERE PROB_TITLE = ''%Unable''

or
SELECT * FROM rccdb.dbo.SEARCH WHERE PROB_TITLE LIKE ''Unable''