DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: How calculate the percentage of area

Threaded View

  1. #2
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width