VijiKumara
Programmer
SQL:
Select Distinct L.NM_LINE, D.nm_fac, S.TRANSFORMER_OPER_ID, S.FEEDER_NUMBER, S.INDUSTRIAL, S.COMMERCIAL, S.RESIDENTIAL, S.TOTAL
from
amp.tb_line L,
amp.tb_sect K,
amp.site D,
amp.trits.feeder_customer S
where K.cd_stat = 'C' and l.cd_stat = 'C'
and K.ik_line = L.ik_line
and D.ik_site = K.ik_site_end
and D.nm_fac = S.SUBSTATION_NAME
UNION
select Distinct L.NM_LINE, D.nm_fac, S.TRANSFORMER_OPER_ID, S.FEEDER_NUMBER, S.INDUSTRIAL, S.COMMERCIAL, S.RESIDENTIAL, S.TOTAL
from
amp.tb_line L,
amp.tb_sect K,
amp.site D,
amp.trits.feeder_customer S
where K.cd_stat = 'C' and l.cd_stat = 'C'
and K.ik_line = L.ik_line
and D.ik_site = K.ik_site_beg;
and D.nm_fac = S.SUBSTATION_NAME;
Following is the result i am getting(Please refer to the image attachment)