You need FULL OUTER JOIN for that. Check the 9i SQL manual for the syntax.
Or another option would be to union-all all four tables and then do your math from there. So the inline view you would use as a starting point would be something like:
select 'TI' AS tbl, LS_ID, SUM(AREA) AS area from area_ti
group by LS_ID
union all
select 'TO' AS tbl, LS_ID, SUM(AREA) AS area from area_to
group by LS_ID
union all
select 'FI' AS tbl, LS_ID, SUM(AREA) AS area from area_fi
group by LS_ID
union all
select 'EM' AS tbl, LS_ID, SUM(AREA) AS area from area_em
group by LS_ID
Last edited by jmodic; 09-27-2004 at 06:44 PM.
Jurij Modic
ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?