Query#1:
select cd_fm_rgn_npl,
sum(amt_ls_estd )as amt_ls_estd,
sum(amt_ls_estd _in_mllns) as amt_ls_estd_in_ mllns
from udbadm.mol_npl_ ls_hst
where dt_rptg_per_npl = '08/31/2006'
group by cd_fm_rgn_npl
Query #2
select cd_fm_rgn_npl,
amt_ls_estd,
amt_ls_estd_in_ mllns
from udbadm.mol_npl_ ls_all_ppty_hst where cd_npl_ls_rpt_t ype = 3 and
dt_rptg_per_npl = '08/31/2006' order by cd_fm_rgn_npl
How do I do calculation between these two queries?
I want to subtract sum(amt_ls_estd ) from query 1
from amt_ls_estd from query 2.
select cd_fm_rgn_npl,
sum(amt_ls_estd )as amt_ls_estd,
sum(amt_ls_estd _in_mllns) as amt_ls_estd_in_ mllns
from udbadm.mol_npl_ ls_hst
where dt_rptg_per_npl = '08/31/2006'
group by cd_fm_rgn_npl
Query #2
select cd_fm_rgn_npl,
amt_ls_estd,
amt_ls_estd_in_ mllns
from udbadm.mol_npl_ ls_all_ppty_hst where cd_npl_ls_rpt_t ype = 3 and
dt_rptg_per_npl = '08/31/2006' order by cd_fm_rgn_npl
How do I do calculation between these two queries?
I want to subtract sum(amt_ls_estd ) from query 1
from amt_ls_estd from query 2.
Comment