Can I use periods "." in field names?
| User, date | Message |
|---|---|
|
Written by Dr. Dave
5 years ago Category: General 95 posts since Sun, 27 Jan 08 |
I hope it's okay to post this question here, as it doesn't particularly relate to HeidiSQL. I'd like to create a field in one of my tables. Instead of using an underscore "_" to separate 2 words, like "first_name", I want to use a period, like "first.name" Is this legal? (no, I'm not interested in using "firstName" or "first_name", unless I absolutely have to) :) Thanks in advance. |
|
Written by kalvaro
5 years ago 442 posts since Thu, 29 Nov 07 |
According to documentation the dot character is allowed in field names: http://dev.mysql.com/doc/refman/5.0/en/identifiers.html I suppose you'll have to quote it every time: SELECT `first.name`FROM users If it's a good idea or not, I leave it to you ;-) |
|
Written by Dr. Dave
5 years ago 95 posts since Sun, 27 Jan 08 |
Thank you, you're absolutely correct. I found this: Before MySQL 5.1.6, database and table names cannot contain “/”, “\”, “.”, or characters that are not allowed in filenames. At this link: http://dev.mysql.com/doc/refman/5.1/en/identifiers.html I think, that although it is possible, it's dangerous and should probably be avoided. I'll just use underscores instead. Again, thank you for the answer. |
|
Please login to leave a reply, or register at first. |