The difference between single quotes, double quotes and backticks in MYSQL

backticks `

  • Backticks are usually placed below the Esc key, together with ~. It is a symbol introduced to distinguish MySQL's reserved words from ordinary characters. 
    create table desc reports an error 
    create table `desc` succeeds
  • Generally, when we build a table, we will add backticks to the table name and library name to ensure the execution of the statement.

single quote ', double quote "

  • In standard SQL, single quotes are used for strings.
  • If the string itself also includes single quotes, use two single quotes (note, not double quotes, double quotes in the string do not need additional escaping).
  • MySQL's extension to SQL allows the use of both single and double quotes.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325526548&siteId=291194637