-
query -values in quotes
i want to dispaly the values of these columsn in single quotes.but it gives me an error.can some one help me what i am missing
select
"'"||column1||"'"
,"'"||column2||"'"
,"'"||column3||"'"
,"'"||column4||"'"
,"'"||column5||"'"
,"'"||column6||"'"
,"'"||column7||"'"
,"'"||column8/90||"'"
,"'"||column9/65||"'"
from table1;
when i execute I get the following error
,"'"||column9/65||"'"
*
ERROR at line 10:
ORA-00904: "'": invalid identifier
Last edited by RamanaSQL; 12-23-2004 at 01:26 PM.
-
Code:
select
''''||column1||''''
,''''||column2||''''
,''''||column3||''''
,''''||column4||''''
,''''||column5||''''
,''''||column6||''''
,''''||column7||''''
,''''||column8/90||''''
,''''||column9/65||''''
from table1;
An ounce of action is worth a ton of theory.
—Friedrich Engels
-
String literals must go between single-quotes. If you want a single-quote to be part of a string it must be entered TWICE. So you need 4 single-quotes in a row to represent a string consisting of one single-quote.
-
thanks for the reply.One more question ,
how do i remove the space between the columns
currently it displays like this
'value1'...........,'value2'............,
instead i would like to display
'value1','value2','value3'
pls let me know
thanks
vg
Last edited by RamanaSQL; 12-23-2004 at 01:27 PM.
-
Originally posted by RamanaSQL
thanks for the reply.One more question ,
how do i remove the space between the columns
currently it displays like this
'value1'...........,'value2'............,
instead i would like to display
'value1','value2','value3'
pls let me know
thanks
vg
RTRIM/LTRIM ?
COLUMN [colname] FORMAT a[length] on SQL*Plus?
An ounce of action is worth a ton of theory.
—Friedrich Engels
-
Like:
Code:
select ''''||value1||''','''||value2||''''
If I've counted correctly
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|