Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> sql with multiple aliases, multirow record

sql with multiple aliases, multirow record

From: Mariusz <mr.m_at_biaman.pl>
Date: 10 Feb 2005 02:15:03 -0800
Message-ID: <63c411ae.0502100215.42e8ecb6@posting.google.com>


Hello,

I have table T1 with multiple row record:

ID code text
1 123 aa \
1 124 bb \
1 134 cc / one logical record
1 322 dd /
2 123 ff
2 124 gg
2 344 hh

3  ...........
3  ............

.......
..........

When I run:
select a.ID, concat(a.text, concat(b.text, c.text)) from T1 a, T1 b, T1 c  where a.code='123' and b.code='124' and c.code='322';

I get:
1 aa bb dd
2 ff gg dd

So, c.text is appened from previous row. How to clear c.text before next pass ?

It should return:

1 aa bb dd
2 ff gg

I other words, how to select one row data from multi-row record ? Regards,
mariusz Received on Thu Feb 10 2005 - 04:15:03 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US