有什么充分的理由我不应该在MySQL的字段名称中使用-(破折号)? [英] Is there any good reasons that I should not use - (dash) in field names in MySQL?
本文介绍了有什么充分的理由我不应该在MySQL的字段名称中使用-(破折号)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在产品表中有一个字段名称category_id.
I have field name category_id in product table.
我也希望类别ID的名称字段作为类别ID.
And also I want name field of category id as category-id.
我是否有充分的理由不应该使用-在字段名称中使用
Is there any good reasons that I should not use - in a field name?
在哪里可以找到我不应该在MySQL字段和表名中使用的字符?
Where can I find which character I should not use in MySQL field and table name?
推荐答案
反对使用连字符的主要原因是,大多数引用都必须随后引用字段名称.否则,对于MySQL和人类而言,它们都将看起来像是一个减法运算符.
The major reason against use of hyphen is that most references must then quote the field names. Otherwise they will look like a subtraction operator, both to MySQL and humans.
这篇关于有什么充分的理由我不应该在MySQL的字段名称中使用-(破折号)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文