What is the difference between single quote (') and double quote(") in relates to using in SQL. When do you use 'xxx' and "xxx"? what is the difference both of them?

Showing Answers 1 - 7 of 7 Answers

single quote is used to write a character string or character in sql query.

but,double quotes are used to print the name in sql screen.

for eg:-

select sysdate "current date" from dual;

current date

-----------------

24-mar-06.

 

in single quote oracle takes the character as a keyword.

 

double quote(") is used to give user defined column alias

example:

select empno , ename "employee name" from emp;

this will print column heading as:  EMPNO        employee name

where as single quote is used for passing a string

select ename||'  is employee since '||hiredate from emp;

  Was this answer useful?  Yes

g_sidhu

  • Feb 6th, 2008
 

Date and character literals must be enclosed within single quotation marks (' ');

If a column alias contains a space, it should be enclosed in double quotation marks.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions