Reputation: 263733
I was wondering why some tutorials and other MySQL management tools use grave accent (`) in their queries like this one below:
SELECT `TableA`.`FieldA`, `TableA`.`FieldB`, `TableA`.`FieldC`
FROM `Databasename`.`TableA`
When it displays the same result with this query below:
SELECT FieldA, FieldB, FieldC
FROM TableA
Upvotes: 41
Views: 14679
Reputation: 332591
The grave is more commonly referred to as a "backtick", which MySQL uses to escape MySQL reserved words.
Wrapping everything in backticks is very common in PHPMyAdmin and various examples because most would rather name tables and columns whatever they like without worrying about naming errors. I don't agree with the practice personally...
Upvotes: 53