Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Cross Table
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;
--
"Some days you're the pigeon, and some days you're the statue." Received on Mon Oct 11 1999 - 05:49:23 CDT