query for report [message #595216] |
Mon, 09 September 2013 08:05 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.gravatar.com/avatar/c86fedf38fdae46febdd4144bf66e65d?s=64&d=mm&r=g) |
furqan
Messages: 115 Registered: January 2012 Location: Hyderabad
|
Senior Member |
|
|
hello sirs
i have a table named actual_qty,
in that table i have data store in the following columns:
MaterialCode Location Qty
------------ -------- ---
1111 vizag 2
2222 vizag 1
3333 vizag 4
1111 hyd 4
2222 hyd 6
3333 hyd 2
1111 sec 9
2222 sec 1
3333 sec 0
i want query to display data data in the following form
MaterialCode vizag hyd sec
------------ ----- --- ---
1111 2 4 9
2222 1 6 1
3333 4 2 0
thanks
|
|
|
|
Re: query for report [message #595220 is a reply to message #595218] |
Mon, 09 September 2013 08:15 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.gravatar.com/avatar/c86fedf38fdae46febdd4144bf66e65d?s=64&d=mm&r=g) |
furqan
Messages: 115 Registered: January 2012 Location: Hyderabad
|
Senior Member |
|
|
i have a table named actual_qty,
in that table i have data store in this columns:
MaterialCode Location Qty
------------ -------- ---
1111 vizag 2
2222 vizag 1
3333 vizag 4
1111 hyd 4
2222 hyd 6
3333 hyd 2
1111 sec 9
2222 sec 1
3333 sec 0
i want query to display data data in the following form
MaterialCode vizag hyd sec
------------ ------ ----- ------
1111 2 4 9
2222 1 6 1
3333 4 2 0
need a query for desired output.
[Updated on: Mon, 09 September 2013 08:20] Report message to a moderator
|
|
|
Re: query for report [message #595221 is a reply to message #595220] |
Mon, 09 September 2013 08:20 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
While using code tags, you need to keep the later tag as [/code] and not [code/]
I have provided a link about PIVOT function, go through the examples and come back with what you tried.
[EDIT : Ok, good that you updated with proper code tags, now it's far better. Thanks]
[Updated on: Mon, 09 September 2013 08:22] Report message to a moderator
|
|
|
|
Re: query for report [message #595225 is a reply to message #595224] |
Mon, 09 September 2013 08:32 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
furqan wrote on Mon, 09 September 2013 19:00
just need to display data as it is...no need to for sum.
Then do not use SUM, simple. Just pivot the way you want.
|
|
|