Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> sql with multiple aliases, multirow record
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