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

后端 未结 13 1096
一个人的身影
一个人的身影 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:34

    It is sometimes useful to not use quotes... because this can highlight issues in the code generating the query... For example:

    Where x and y are should always be integers...

    SELECT * FROM table WHERE x= AND y=0

    Is a SQL syntax error... a little lazy but can be useful...

提交回复
热议问题