This content has been marked as final.
Show 2 replies
-
1. Re: What is the difference between single quote (') and double quote(") ?
Frank Kulash Oct 23, 2009 7:09 PM (in response to 536364)Hi,
Single-quotes are used to enclose string literals (and, in recent versions, DATE literals).
Double-quotes are used to enclose identifiers (like table and column names) . They are optional (and therefore almost never used) when the name conforms to certain rules for names (starts with a letter, no spaces or special symbols, no lower-case letters, ...).
For example
Output:SELECT 'Hello, world!' AS "My Greeting" FROM dual;
'Hello, world!' is a string literal, so it is enclosed in single-quotes.My Greeting ------------- Hello, world!
The column alias "My Greeting" is not a normal identifier name: it contans lower-case letters and a space, so it must be enclosed in double-quotes.
The table name DUAL is a normal identifer: it is all capital letters, no spaces. I have the choice of referring to it as "DUAL" (all capital letters, inside double-quotes) or as DUAL, dual, Dual, dUAL, dUaL, ... (without quotes). -
2. Re: What is the difference between single quote (') and double quote(") ?
Hoek Oct 23, 2009 7:23 PM (in response to 536364)http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/sql_elements008.htm#SQLRF51129
http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10472/fundamentals.htm#LNPLS199
edit
what is the difference both of them?
Actually: it's best to just forget about the double quotes ;)
Edited by: hoek on Oct 23, 2009 9:22 PM