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

Home -> Community -> Usenet -> c.d.o.misc -> Re: oracle sql query - output one line?

Re: oracle sql query - output one line?

From: DA Morgan <damorgan_at_x.washington.edu>
Date: Tue, 08 Mar 2005 10:50:24 -0800
Message-ID: <1110307629.921293@yasure>


Michel Cadot wrote:

> "DA Morgan" <damorgan_at_x.washington.edu> a écrit dans le message de news:1110297232.387436_at_yasure...

> | captain_2010_at_yahoo.com wrote:
> | > hi,
> | >
> | > Below is the output required, how ?
> | >
> | > Total 1980 1981 1982 1983
> | > 20 1 3 5 2
> | >
> | >
> | > SQL written below gives output as
> | >
> | > TOTAL TO_C
> | > --------- ----
> | > 1 1980
> | > 10 1981
> | > 1 1982
> | > 1 1987
> | >
> | > SQL:
> | > select count(*) as Total,to_char(hiredate,'yyyy') from emp group by
> | > to_char(hiredate,'yyyy');
> | >
> | > How to get output as given above i.e. in one line.
> | >
> | > Captain
> |

> | Type it into notepad.
> |

> | There is no way to get the result above from the data below.
> 
> That's not fully true:
> 
> select 20 "Total", 1 "1980", 3 "1981", 5 "1982", 2 "1983" from emp where rownum=1;
> 
> ;-)
> Michel Cadot

I stand corrected. Thanks. ;-)

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Tue Mar 08 2005 - 12:50:24 CST

Original text of this message

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