Escaping and quoting examples
Quote nested column names and reserved words with backticks, and string literals with single quotes.
Nested columns and reserved words
SELECT foo.`bar`
FROM mytable;
String literals
Escape a single quote in a string literal by doubling it:
SELECT 'some string literal', 'It''s here'
FROM mytable;
Escape strings
Escape strings start with E and accept escape sequences, such as
\n (new line), \t (tab), and \x41
(hexadecimal character code):
SELECT E'first line\nsecond line'
FROM mytable;
