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: Cross Table

Re: Cross Table

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Mon, 11 Oct 1999 18:49:23 +0800
Message-ID: <3801C0B3.F9B@yahoo.com>


Eduard Filipas wrote:
>
> Does oracle support Cross table method ?
> If it does how can i access it ? i picked it up from microsoft's
> access.
>
> example ...
> road code_of_road costs
> 1 A1 13$
> 2 B2 10$
> 3 H 05$
> 4 A1 03$
>
> Result ...
> A1 B2 H
> 13$ 10$ 05$
> 03$ 0$ 0$
>
> thank you for help
> Edo

Check out decode which will achieve this as long as one of the dimensions is finite...

eg

select decode(code,'A1',cost,0) a1,
 decode(code,'B2',cost,0) b2,
 decode(code,'H',cost,0) h,
 ...
from table;
--



Connor McDonald
"These views mine, no-one elses etc etc" connor_mcdonald_at_yahoo.com

"Some days you're the pigeon, and some days you're the statue." Received on Mon Oct 11 1999 - 05:49:23 CDT

Original text of this message

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