Re: Pivot table Query - Need help in building correct logic
From: Pankaj <harpreet.noni_at_gmail.com>
Date: Thu, 3 Dec 2009 16:28:26 -0800 (PST)
Message-ID: <b5668e45-f7af-480e-9335-41bb0b40274e_at_x15g2000vbr.googlegroups.com>
On Dec 3, 7:08�pm, Peter Nilsson <ai..._at_acay.com.au> wrote:
> On Dec 4, 10:36�am, Pankaj <harpreet.n..._at_gmail.com> wrote:
>
>
>
>
>
> > Greetings,
>
> > I have a table format as below
>
> > sec � � � value � � � �type
> > X � � � � �100 � � � � � T
> > X � � � � �200 � � � � � S
> > Y � � � � 300 � � � � � �T
> > Y � � � � 400 � � � � � �S
> > Z � � � � �500 � � � � � T
> > Z � � � � �600 � � � � � S
>
> > I want to pivot the above to somethin as below
>
> > sec � � T � � � � � S
> > X � � � �100 � � � �200
> > Y � � � �300 � � � 400
> > Z � � � �500 � � � �600
>
> > Can anyone please advise. I have been looking for pivot
> > logic for some time but could not figure this out.
>
> � <http://www.lmgtfy.com/?q=oracle+pivot+query&l=1>
>
> --
> Peter- Hide quoted text -
>
> - Show quoted text -
Date: Thu, 3 Dec 2009 16:28:26 -0800 (PST)
Message-ID: <b5668e45-f7af-480e-9335-41bb0b40274e_at_x15g2000vbr.googlegroups.com>
On Dec 3, 7:08�pm, Peter Nilsson <ai..._at_acay.com.au> wrote:
> On Dec 4, 10:36�am, Pankaj <harpreet.n..._at_gmail.com> wrote:
>
>
>
>
>
> > Greetings,
>
> > I have a table format as below
>
> > sec � � � value � � � �type
> > X � � � � �100 � � � � � T
> > X � � � � �200 � � � � � S
> > Y � � � � 300 � � � � � �T
> > Y � � � � 400 � � � � � �S
> > Z � � � � �500 � � � � � T
> > Z � � � � �600 � � � � � S
>
> > I want to pivot the above to somethin as below
>
> > sec � � T � � � � � S
> > X � � � �100 � � � �200
> > Y � � � �300 � � � 400
> > Z � � � �500 � � � �600
>
> > Can anyone please advise. I have been looking for pivot
> > logic for some time but could not figure this out.
>
> � <http://www.lmgtfy.com/?q=oracle+pivot+query&l=1>
>
> --
> Peter- Hide quoted text -
>
> - Show quoted text -
Thanks Peter. As I said earlier, I did tried google but could not found the correct way of implementing the logic. Also, the domain for sec is not fixed. I have just shown X, Y and Z but there could be more.
Thanks for your time. Received on Thu Dec 03 2009 - 18:28:26 CST