I'm thinking of having a program that dynamically creates new tables as the need arises. Can I have tables named with just numbers in MySQL?
Rules for naming objects, including tables in MySql:
http://dev.mysql.com/doc/refman/5.1/en/identifiers.html
Identifiers may begin with a digit but unless quoted may not consist solely of digits.
So this would be invalid:
SELECT * FROM 12345;
But the following would be valid:
SELECT * FROM `12345`;
Or if running in ANSI mode the following would work:
SET @@session.sql_mode=ANSI_QUOTES;
SELECT * FROM "12345";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With