Answer the question
In order to leave comments, you need to log in
Why write backticks in sql queries?
Hello!
I meet 2 types of sql queries:
1) SELECT `id` FROM `table` WHERE `column` = 'value'
2) SELECT id FROM table WHERE column = 'value'
From here I have a question, why do I need to write apostrophes in a sql query and which option 1 or 2 is more correct and why?
Answer the question
In order to leave comments, you need to log in
why do you need to write apostrophes in sql queryThis is escaping in case of using reserved words in table and column names.
which option 1 or 2 is more correct and whyIt is correct to write with escaping, because the names can come from anywhere and anything can be there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question