这是 phpMyAdmin 为我生成的 SQL 语句:
SELECT * FROM `table_name` WHERE 1
可以看到 table_name
被 ` 字符包围。
为什么?
最佳答案
用于包围identifiers在 MySQL 中。
它允许它们包含在普通 SQL 中会产生歧义或无效的字符,例如空格:
`foo bar` - is a valid MySQL identifier
foo bar - is not, since foo is the identifier, and bar is ambiguous
关于sql - SQL 中表/字段名称周围的`s 是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4904173/