"year" as a Column Name in a MySQL Table
Is it ok开发者_C百科ay to name a column in a MySQL table year
? Any reason not to?
If you quote your identifiers properly, you can use almost any word you want:
SELECT * FROM `select` WHERE `select`.id > 100;
You can name it year
, there is no reason not to do so because it is not the reserved keyword of mysql/sql.
Check the MySQL Keywords list if you're ever curious.
Please note that from version 5.5 YEAR is a reserved keyword.
I also think that in this case statenjason's answer "Check the MySQL Keywords list if you're ever curious." should be the right one.
It's not one of the reserved words, so it should be fine.
精彩评论