dbTalk Databases Forums  

Pivot table Query - Need help in building correct logic

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Pivot table Query - Need help in building correct logic in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Pankaj
 
Posts: n/a

Default Pivot table Query - Need help in building correct logic - 12-03-2009 , 05:36 PM






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

Reply With Quote
  #2  
Old   
Peter Nilsson
 
Posts: n/a

Default Re: Pivot table Query - Need help in building correct logic - 12-03-2009 , 06:08 PM






On Dec 4, 10:36*am, Pankaj <harpreet.n... (AT) gmail (DOT) com> wrote:
Quote:
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

Reply With Quote
  #3  
Old   
Pankaj
 
Posts: n/a

Default Re: Pivot table Query - Need help in building correct logic - 12-03-2009 , 06:28 PM



On Dec 3, 7:08*pm, Peter Nilsson <ai... (AT) acay (DOT) com.au> wrote:
Quote:
On Dec 4, 10:36*am, Pankaj <harpreet.n... (AT) gmail (DOT) 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.

Reply With Quote
  #4  
Old   
joel garry
 
Posts: n/a

Default Re: Pivot table Query - Need help in building correct logic - 12-03-2009 , 07:04 PM



On Dec 3, 4:28*pm, Pankaj <harpreet.n... (AT) gmail (DOT) com> wrote:
Quote:
On Dec 3, 7:08*pm, Peter Nilsson <ai... (AT) acay (DOT) com.au> wrote:



On Dec 4, 10:36*am, Pankaj <harpreet.n... (AT) gmail (DOT) 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/...D: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

Reply With Quote
  #5  
Old   
Pankaj
 
Posts: n/a

Default Re: Pivot table Query - Need help in building correct logic - 12-03-2009 , 08:02 PM



On Dec 3, 7:04*pm, joel garry <joel-ga... (AT) home (DOT) com> wrote:
Quote:
On Dec 3, 4:28*pm, Pankaj <harpreet.n... (AT) gmail (DOT) com> wrote:





On Dec 3, 7:08*pm, Peter Nilsson <ai... (AT) acay (DOT) com.au> wrote:

On Dec 4, 10:36*am, Pankaj <harpreet.n... (AT) gmail (DOT) 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/...11_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.

Reply With Quote
  #6  
Old   
Gerard H. Pille
 
Posts: n/a

Default Re: Pivot table Query - Need help in building correct logic - 12-05-2009 , 07:12 AM



Pankaj schreef:
Quote:
On Dec 3, 7:04 pm, joel garry<joel-ga... (AT) home (DOT) com> wrote:
....
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.
Joel, the CDOM Google search engine.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.