Documentation Home
MySQL 8.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 38.1Mb
PDF (A4) - 38.1Mb
PDF (RPM) - 33.0Mb
HTML Download (TGZ) - 8.1Mb
HTML Download (Zip) - 8.1Mb
HTML Download (RPM) - 6.9Mb
Man Pages (TGZ) - 132.7Kb
Man Pages (Zip) - 189.0Kb
Info (Gzip) - 3.4Mb
Info (Zip) - 3.4Mb
Excerpts from this Manual

MySQL 8.0 Reference Manual  /  ...  /  The quote_identifier() Function

26.4.5.18 The quote_identifier() Function

Given a string argument, this function produces a quoted identifier suitable for inclusion in SQL statements. This is useful when a value to be used as an identifier is a reserved word or contains backtick (`) characters.

Parameters

in_identifier TEXT: The identifier to quote.

Return Value

A TEXT value.

Example
mysql> SELECT quote_identifier('plain');
+---------------------------+
| quote_identifier('plain') |
+---------------------------+
| `plain`                   |
+---------------------------+
mysql> SELECT quote_identifier('trick`ier');
+-------------------------------+
| quote_identifier('trick`ier') |
+-------------------------------+
| `trick``ier`                  |
+-------------------------------+
mysql> SELECT quote_identifier('integer');
+-----------------------------+
| quote_identifier('integer') |
+-----------------------------+
| `integer`                   |
+-----------------------------+

User Comments
User comments in this section are, as the name implies, provided by MySQL users. The MySQL documentation team is not responsible for, nor do they endorse, any of the information provided here.
Sign Up Login You must be logged in to post a comment.