From: Pankaj on
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.

TIA
From: Peter Nilsson on
On Dec 4, 10:36 am, Pankaj <harpreet.n...(a)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
From: Pankaj on
On Dec 3, 7:08 pm, Peter Nilsson <ai...(a)acay.com.au> wrote:
> On Dec 4, 10:36 am, Pankaj <harpreet.n...(a)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.
From: joel garry on
On Dec 3, 4:28 pm, Pankaj <harpreet.n...(a)gmail.com> wrote:
> On Dec 3, 7:08 pm, Peter Nilsson <ai...(a)acay.com.au> wrote:
>
>
>
> > On Dec 4, 10:36 am, Pankaj <harpreet.n...(a)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
--
@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 Clarkson
From: Pankaj on
On Dec 3, 7:04 pm, joel garry <joel-ga...(a)home.com> wrote:
> On Dec 3, 4:28 pm, Pankaj <harpreet.n...(a)gmail.com> wrote:
>
>
>
>
>
> > On Dec 3, 7:08 pm, Peter Nilsson <ai...(a)acay.com.au> wrote:
>
> > > On Dec 4, 10:36 am, Pankaj <harpreet.n...(a)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...
>
> You must be so cool, getting people to google for you!
>
> jg
> --
> @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 Clarkson- Hide quoted text -
>
> - Show quoted text -

Thanks Joel. I will get back in case any more queries.
 |  Next  |  Last
Pages: 1 2
Prev: The job of a relational DBMS
Next: VARCHAR2 Length