PDA

View Full Version : what is the difference between ""and ''?


Deo.Dy
11-08-2007, 06:49 AM
Hi,guys!
I have some questions when I operating DB! When i write sql-language I always being confused with the difference between "" and ''?
So,please tell me the difference.Thanks!

shyam
11-08-2007, 07:00 AM
u mean single(') and double(") quotes ?

single quotes are used for string literals like in the where clause

select ...
where name = 'jack';

double quotes are used to escape object names that might also be keywords in MySQL eg. when u have a table with order as a column name
select ...
where ...
order by "order"

guelphdad
11-08-2007, 01:28 PM
double quotes are used to escape object names that might also be keywords in MySQL eg. when u have a table with order as a column name
select ...
where ...
order by "order"

Really the best scenario is to not use reserved words in the first place.

Deo.Dy
11-20-2007, 08:05 AM
Thanks ! It is very kind of you!