When to use single quotes, double quotes, and backticks in MySQL

后端 未结 13 1057
一个人的身影
一个人的身影 2021-01-26 10:55

I am trying to learn the best way to write queries. I also understand the importance of being consistent. Until now, I have randomly used single quotes, double quotes, and backt

13条回答
  •  天涯浪人
    2021-01-26 11:49

    Besides all of the (well-explained) answers, there hasn't been the following mentioned and I visit this Q&A quite often.

    In a nutshell; MySQL thinks you want to do math on its own table/column and interprets hyphens such as "e-mail" as e minus mail.


    Disclaimer: So I thought I would add this as an "FYI" type of answer for those who are completely new to working with databases and who may not understand the technical terms described already.

提交回复
热议问题