In MySQL we can create queries with or without the backtick (`
) symbol. Example:
SELECT * FROM TEST;
SELECT * FROM `TEST`;
Both works fine in mysql-console.
Is there any technical difference between them?
Is there any benefit using (`
) over over simple queries?
Best Answer
They are called quoted identifiers and they tell the parser to handle the text between them as a literal string. They are useful for when you have a column or table that contains a keyword or space. For instance the following would not work:
But the following would:
Also, the following would get an error, because
COUNT
is a reserved keyword:But the following would be parsed correctly:
I hope this helps you.