Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: UNION question
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 )
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 GmbHReceived on Fri Sep 07 2001 - 07:19:01 CDT
![]() |
![]() |