Re: How to transpose?

From: David Di Biaggio <dibiaggio_at_iquest.net>
Date: 1996/05/23
Message-ID: <31A4E57E.653E_at_iquest.net>#1/1


Jerry Sy wrote:
>
> >hsing_at_ix.netcom.com (Peter Y. Hsing) wrote:
> >>Mason:
> >>
> >>This is interesting. Do you mind if I ask why you need to transpose?
> >>How is the transposed data going to be used, ie, do you really need to
> >>transpose the data?
> >>
>
> I encounter this need on many occasions, mostly during report
> generation.
>
> say data is stored as
>
> A B C D
> 1990
> 1991
> 1992
> 1993
> 1994
> 1995
> 1996
>
> and some manager wants a report format
>
> 90 91 92 93 94 95 96
> A
> B
> C
> D
>
> I am sure there are lots more cases where a transposition
> is needed.

Using a variation of sum(decode(.....)) you can do this. Look in the SQL*Plus User's guide I think for examples of what they call matrix (or cross-tabular) reporting. I would give you the syntax but don't have my book here and it's not very straightforward....good luck! Received on Thu May 23 1996 - 00:00:00 CEST

Original text of this message