Re: Pivot table Query - Need help in building correct logic
From: joel garry <joel-garry_at_home.com>
Date: Thu, 3 Dec 2009 17:04:38 -0800 (PST)
Message-ID: <09068704-c7ca-4dce-b482-c6c4d171c633_at_r24g2000prf.googlegroups.com>
On Dec 3, 4:28 pm, Pankaj <harpreet.n..._at_gmail.com> wrote:
> 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.
Date: Thu, 3 Dec 2009 17:04:38 -0800 (PST)
Message-ID: <09068704-c7ca-4dce-b482-c6c4d171c633_at_r24g2000prf.googlegroups.com>
On Dec 3, 4:28 pm, Pankaj <harpreet.n..._at_gmail.com> wrote:
> 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.
Oddly enough, clicking on that link led me directly to this one: http://asktom.oracle.com/pls/asktom/f?p=100:11:0::NO::P11_QUESTION_ID:766825833740
You must be so cool, getting people to google for you!
jg
-- _at_home.com is bogus. "Contrary to what I said at the time, we must go after the idiots who lost the discs and stick cocktail sticks in their eyes until they beg for mercy." - Jeremy ClarksonReceived on Thu Dec 03 2009 - 19:04:38 CST