2

I need to write a query where I need to find the ' character.

Like Shivam's - I need to find the ' mark.

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

2 Answers 2

11

Just need to escape it.

SELECT * FROM DTCountries WHERE CountryCode LIKE '%''%'
1
  • The other answer was accepted even though mine came in first (beat him by a whole second... lol), but I still appreciate the Upvotes everyone's been giving. And, yes, seems like a dupe question. Jun 18, 2012 at 16:55
7

Double it up

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.