1)select t1.id "识别号",t1.mc "名称",sum(t2.ynse) 应纳税额,sum(t3.sjse) 实缴税额 sum(t2.ynse)-sum(t3.sjse) 欠税
from table1 t1 left join table2 t2 on t1.id=t2.id left join table3 t3 on t1.id=t3.id
where t2.sbrq='2003-11' and t3.kprq='2003-11'
group by id
2)select t1.id ,t2.*,t3.*
from table1 t1 left join table2 t2 on t1.id=t2.id left join table3 t3 on t1.id=t3.id
from table1 t1 left join table2 t2 on t1.id=t2.id left join table3 t3 on t1.id=t3.id
where t2.sbrq='2003-11' and t3.kprq='2003-11'
group by id
2)select t1.id ,t2.*,t3.*
from table1 t1 left join table2 t2 on t1.id=t2.id left join table3 t3 on t1.id=t3.id
from table1 a left outer join table2 b on a.id = b.id
left join table3 c on a.id = b.id
group by a.id
from table1 a left outer join table2 b on a.id = b.id
left join table3 c on a.id = b.id
where b.sbrq='2003-11' and c.kprq='2003-11'
group by a.id
from table1 a,table2 b,table3 c where a.id=b.id(+) and a.id=c.id(+) and b.sbrq='2003-11' and c.kprq='2003-11'
group by a.id