This section describes how to write literal
values in MySQL. These include strings, numbers,
hexadecimal values, boolean values, and NULL.
The section also covers the various nuances and
βgotchasβ? that you may run into when dealing
with these basic types in MySQL.
A string is a sequence of characters, surrounded
by either single quote (β'β) or double quote (β"β)
characters. Examples:
'a string'
"another string"
If the server SQL mode has ANSI_QUOTES enabled,
string literals can be quoted only with single
quotes. A string quoted with double quotes is
interpreted as an identifier.
As of MySQL 4.1.1, string literals may have an
optional character set introducer and COLLATE clause:
[_charset_name]'string' [COLLATE collation_name]
Examples:
SELECT _latin1'string';
SELECT _latin1'string' COLLATE latin1_danish_ci;