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 -> Re: sql with multiple aliases, multirow record

Re: sql with multiple aliases, multirow record

From: Frank Piron <empty_at_zero.nil>
Date: Thu, 10 Feb 2005 12:54:59 +0100
Message-ID: <opslzcpxu4m0et4w@news.online.de>


Hi,
Am 10 Feb 2005 02:15:03 -0800 schrieb Mariusz <mr.m_at_biaman.pl>:

<snip>
</snip>
> 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

If i got you right, you have to ensure that your data sources share a common id:

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' and

         a.id=b.id=c.id;

regards

-- 
Frank Piron,
defrankatkonaddot
(leftrotate two)
Received on Thu Feb 10 2005 - 05:54:59 CST

Original text of this message

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