开发者

Why are SQL fieldnames sometimes spelled like `this`?

开发者 https://www.devze.com 2022-12-19 21:43 出处:网络
开发者_如何学GoWhat\'s the difference between SELECT * FROM `this` and SELECT * FROM this ?The former is escaped, the latter isn\'t. Consider:
开发者_如何学Go

What's the difference between

SELECT * FROM `this`

and

SELECT * FROM this

?


The former is escaped, the latter isn't. Consider:

SELECT * FROM `FROM`

On systems where the the backtick is an escape, that would select from a table called FROM (whereas without the backticks, it's a syntax error). Some systems use square brackets instead, e.g., SELECT * FROM [FROM].

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号