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

Home -> Community -> Usenet -> c.d.o.server -> Re: UNION question

Re: UNION question

From: Stephan Langer <slanger_at_dixi-wc.de>
Date: Fri, 07 Sep 2001 14:19:01 +0200
Message-ID: <3B98BB35.CBF55F39@dixi-wc.de>


Hi JJ,

you can try

select partno || '_1' from (

        SELECT tbl1.partNo FROM myPartsTblNo1 tbl1
        UNION
        SELECT tbl2.partNo FROM myPartsTblNo2 tbl2
        )
union select partno || '_2' from (
        SELECT tbl1.partNo FROM myPartsTblNo1 tbl1
        UNION
        SELECT tbl2.partNo FROM myPartsTblNo2 tbl2
        )

ORDER BY partNo
;

is this what you want?

hth
Stephan

JJ schrieb:

> Hi,
>
> I have the following SQL statement (example):
>
> SELECT tbl1.partNo || '_1' FROM myPartsTblNo1 tbl1
> UNION
> SELECT tbl2.partNo || '_2' FROM myPartsTblNo2 tbl2
> ORDER BY partNo
>
> Does the UNION work as it should here?
> If there is the same partNo in both tables and I'm appending '_1' and '_2'
> there will be two different "part numbers" and the UNION doesn't fill any
> function. Is this correct och wrong?
>
> --
> Best regards
> Joacim Jarkeborn

--
Mit freundlichen Gr$B|_(Ben

Stephan Langer,
QITS GmbH
Received on Fri Sep 07 2001 - 07:19:01 CDT

Original text of this message

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