mysqlspecial-characters

Are there reasons not to use hyphens in column names?


To a product table I want to add a category-id column.

Are there reasons not to use - in a column name? Where can I find which characters I can and should not use in MySQL column and table names?


Solution

  • 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.