hi,
i have 3 scripts to which they have different third column output
now i do want to merge them for a corresponding output.
here are my scripts:script 1:
select p.name principal, cl.name, count(*) "OR_COUNT"
from iteneraries i,receipts r,customers p,customers c,collectors cl
where i.pcode=p.code
and i.pcode = p.pcode
and i.bank_provider = p.bank_provider
and i.cust_code=c.code
and i.pcode = c.pcode
and i.bank_provider = c.bank_provider
and i.code=r.it_no
and i.pcode=r.pcode
and i.coll_code=cl.code
and (i.status is null or i.status='S')
and to_char(i.coll_date,'YYYYMMDD') >= 'date'
and to_char(i.coll_date,'YYYYMMDD') <= 'date'
and (substr(cl.name,1,3)='COL'
group by p.name,cl.name

script 3:
select p.name principal,cl.name,count(b.ref_no) "INV_COUNT"
from iteneraries i,receipts r,payments b,customers p,customers c,collectors cl
where i.pcode=p.code
and i.pcode = p.pcode
and i.bank_provider = p.bank_provider
and i.cust_code=c.code
and i.pcode = c.pcode
and i.bank_provider = c.bank_provider
and i.code=r.it_no
and i.pcode=r.pcode
and r.code=b.rct_code
and i.coll_code=cl.code
and (i.status is null or i.status='S')
and to_char(i.coll_date,'YYYYMMDD') >= 'date'
and to_char(i.coll_date,'YYYYMMDD') <= 'date'
and (substr(cl.name,1,3)='COL'
group by p.name,cl.name) inv
where or.name=chk.name
and chk.name=inv.name
order by or.name