|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Difference in quoted table name
Some utilities like SQLyog, MySQL Query Builder, mysqldump quote table names when they generate query code.
These queries seem to operate exactly the same and I do not see any difference: Code:
SELECT * FROM DataBase1.Table1; SELECT * FROM 'DataBase1.Table1'; Is there any difference? Is there an advantage to quotes for the table name? Is it just a preference? I would appreciate any comments that might add to my understanding. Thanks, John Brown |
|
#2
|
||||
|
||||
|
yes, there is a very big difference
the first query returns rows from a table the second query is invalid, as it is attempting to return something from a string you probably meant backticks, not quotes ![]() SELECT * FROM `DataBase1.Table1` the backticks are required if the identifier (table name, column name, etc.) contains special characters or is a reserved word the best advice is never to name anything with a reserved word or containing special characters then you won't need the backticks at all |
|
#3
|
|||
|
|||
Well I have learned something today! I live in the Ozark Mountains in Arkansas USA and if a redneck like me hears backtick, we do not think of a keyboard. I had to call someone into my office to read this and we collaborated to find the backtick on my keyboard. I found it so I do not have to buy a new keyboard. Seriously, I did not know and I need to know. Your comment was kind and most appreciated. Quote:
|
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > Difference in quoted table name |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|