Log in

View Full Version : A question about syntax



borris83
04-24-2009, 10:13 AM
Say I have a query:

SELECT * FROM my_table WHERE my_name = 'borris'


What is the difference between enclosing borris in single quotes like this: 'borris' and enclosing with backticks: `borris`


Because sometimes queries work only if certain terms are enclosed with backticks but the same query doesn't work if those terms are enclosed with single quotes.

amutha
04-24-2009, 10:24 AM
SELECT * FROM my_table WHERE my_name = 'borris'


What is the difference between enclosing borris in single quotes like this: 'borris' and enclosing with backticks: `borris`


Because sometimes queries work only if certain terms are enclosed with backticks but the same query doesn't work if those terms are enclosed with single quotes.

Mostly terms are enclosed with backticks is work in the query. :)

borris83
04-24-2009, 10:42 AM
Mostly terms are enclosed with backticks is work in the query.

Yes, But I am asking,why is it so? There should be a rule about where single quotes are acceptable and where they are not

amutha
04-24-2009, 11:04 AM
you see this link

http://www.learn-mysql-tutorial.com/Identifiers.cfm

:)