Query - Urgent (Merged) [message #203381] |
Tue, 14 November 2006 23:56 |
deepak samal
Messages: 29 Registered: February 2005
|
Junior Member |
|
|
I am getting data in below format as,
Id Data1 Data2 Data3
10 101
10 201
10 202
10 301
10 302
But I want to get data in below format without using any intermediate Table,
Id Data1 Data2 Data3
10 101 201 301
10 101 202 302
How can i ??
please send me soon please .
regards
deepak
|
|
|
|
|
|
Re: Query For select - urgent [message #203414 is a reply to message #203404] |
Wed, 15 November 2006 01:40 |
bala_id
Messages: 27 Registered: July 2005
|
Junior Member |
|
|
Hi,
Still your requirement is not proper. Anyway try using the following query. I think this will fullfil your requirement.
SELECT A.DATA1,B.DATA2,C.DATA3 FROM
(SELECT DATA1 FROM TEST WHERE DATA1 IS NOT NULL) A,
(SELECT DATA2 FROM TEST WHERE DATA2 IS NOT NULL) B,
(SELECT DATA3 FROM TEST WHERE DATA3 IS NOT NULL) C
Please revert back, if you have any clarifications on this.
Thanks & Best Regards,
Bala
|
|
|
Re: Query For select - urgent [message #203417 is a reply to message #203403] |
Wed, 15 November 2006 01:50 |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
deepak samal wrote on Wed, 15 November 2006 07:53 | HI ,
i have again attached a file as this window does not support this format.
please send me the query . its urgent
|
If you would read the stickies in the Newbie forum, you would see how to format your post so you don't need these attachments.
Furthermore, you would see that it is not polite (or serve any purpose) to state that your requirement is urgent. It is neither our fault, nor our problem you started too late.
[Edit: and on top of that I merged two topics. Please continue in your original thread, instead of opening a new one if it is about the same issue]
[Updated on: Wed, 15 November 2006 01:58] Report message to a moderator
|
|
|
Re: Query For select - urgent [message #203673 is a reply to message #203417] |
Thu, 16 November 2006 00:29 |
SLakkaraju
Messages: 1 Registered: August 2005 Location: Hyderabad
|
Junior Member |
|
|
Deepak,
Try the following query ...
SELECT ID, SUM(NVL(DATA1, 0)) DATA1, SUM(NVL(DATA2, 0)) DATA2, SUM(NVL(DATA3, 0)) DATA3
FROM MYTABLE
GROUP BY ID
Assumed the following:
> MYTABLE has not more than 3 records for each ID.
> Each record for a given ID, no two records have value
for the same DATA# column.
If this wasn't your requirement, do let me know.
HTH,
Shankar Lakkaraju
|
|
|