Subject | Re: [firebird-support] Outer Join with Union Problem |
---|---|
Author | Chris Wallis |
Post date | 2004-06-19T01:28:34Z |
>Doesn't a simple (i.e. non-unioned) full join get your result?Sadly no. That was my original approach, but the rows from the earlier
portfolio are not being preserved in the output. I must confess that this is
using IB 5.6 not Firebird (although I'm using FB for everything new!). I ran
a query against each portfolio separately, and compared the results, and the
rows from the earlier portfolio are not preserved in the output.
This is the full outer join code:
select
h0.sec_id,
h0.HLDG_SHARES,
h0.HLDG_MKT_VALUE,
h0.HLDG_PAR_VALUE,
h.sec_id,
h.HLDG_SHARES,
h.HLDG_MKT_VALUE,
h.HLDG_PAR_VALUE
from holdings h0 full outer join
holdings h on h0.sec_id=h.sec_id
where h0.hsd_doc_id=40022 and
h.hsd_doc_id=42519 and
h0.hldg_seqno >0
order by 1