Skip to content

Instantly share code, notes, and snippets.

@dburger
Created July 13, 2009 05:15
Show Gist options
  • Save dburger/145946 to your computer and use it in GitHub Desktop.
Save dburger/145946 to your computer and use it in GitHub Desktop.
-- mysql has an default escape character \
SELECT * FROM people WHERE symbol LIKE 'hello\_world';
-- or you can specify the escape character
SELECT * FROM people WHERE symbol LIKE 'hello|_world' ESCAPE '|';
-- tsql has no default but you can go with a single character class
SELECT * FROM people WHERE symbol LIKE 'hello[_]world';
-- or you can specify an escape character
SELECT * FROM people WHERE symbol LIKE 'hello|_world' ESCAPE '|';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment