Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL statement question ........

Re: SQL statement question ........

From: Dave Waterworth <pscdaw_at_ihug.com.au>
Date: Sun, 13 Jun 1999 00:18:26 +1000
Message-ID: <7jtq54$kq$1@toto.tig.com.au>


Oops, that should have been DUAL rather than DAUL, and should probably use UNION ALL as well!

Dave Waterworth wrote in message <7jtpj8$t86$1_at_toto.tig.com.au>...
>Jimmy
>
>I'm not sure if I understand what you require, but is this it?
>
>SELECT 'a_date, bbb, ccc' FROM DAUL
>UNION
>select to_char(aaa, 'DD-MON-YYYY') || ',' || bbb || ',' ||ccc from T_aa;
>
>Dave Waterworth
>Power Systems Consultants NZ Ltd
>
>Jimmy wrote in message <3763333A.3F096431_at_comp.polyu.edu.hk>...
>>Hello all,
>>
>> I have a table aaa as follows:
>>
>>create table T_aa (
>>aaa date,
>>bbb varchar2(10),
>>ccc number);
>>
>>And I want to get the following result with SQL select statement:
>>
>>a_date, bbb, ccc
>>01-Jan-1999,50,1
>>02-Jan-1999,,1
>>03-Jan-1999,70,2
>>(column aaa renamed to a_date)
>>
>>And I write the following SQL statement:
>>
>>select to_char(aaa, 'DD-MON-YYYY') a_date || ',' || bbb || ',' ||ccc
>>from T_aa;
>>
>>however, the above statement is invalid. Is is possible to get the
>>result that I want by using a single SQL statement?
>>
>>Thanks,
>>Jimmy
>>
>>
>
>
Received on Sat Jun 12 1999 - 09:18:26 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US