2012-06-13 183 views
2

我需要寫一個查詢,我需要找到'字符。SQL特殊字符

像Shivam的 - 我需要找到'標記。

select * from DTCountries where CountryCode like '%'%' 
+1

可能重複[我怎樣逃避SQLSERVER單引號?](http://stackoverflow.com/questions/1586560/how-do-i- escape-a-single-quote-in-sqlserver) –

回答

7

加倍了

select * from DTCountries where CountryCode like '%''%' 
11

只需要逃避它。

SELECT * FROM DTCountries WHERE CountryCode LIKE '%''%' 
+0

即使我第一次進來(擊敗了他整整一秒鐘......),我仍然接受了其他答案,但我仍然讚賞每個人都在奉獻的Upvotes。而且,是的,好像是一個愚蠢的問題。 –