Using backticks around field names

前端 未结 11 1600
-上瘾入骨i
-上瘾入骨i 2020-11-22 02:05

After reading a couple of answers and comments on some SQL questions here, and also hearing that a friend of mine works at a place which has a policy which bans them, I\'m w

11条回答
  •  感动是毒
    2020-11-22 02:41

    To me it makes a lot of sense to use them at all times when dealing with field names.

    • Firstly, once you get into the habit, it doesn't hurt to just hit the backtick key.
    • Secondly, to me, it makes it easier to see what exactly are the fields in your query, and what are keywords or methods.
    • Lastly, it allows you to use whatever field name you wish when designing your table. Sometimes it makes a lot of sense to name a field "key", "order", or "values"... all of which require backticks when referring to them.

提交回复
热议问题