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
解决方案 »
- initorcl.ora丢失怎么办
- ORACLE中的TO_CHAR 格式化数值时的疑惑
- unix下c++用proc/c++连接oracle数据库,怎么编译-急急急急急急???
- oracle 返回的select 结果集的proc 如何写?
- ORACLE有SQL Server2000的[OPENROWSET]相同功能的函数吗?
- 请问oracle中case...if怎么用在这里呀????谢了!!!
- 连接字符串中的服务名
- 一个关于“oracle事务处理”的严重问题,请哥哥们帮忙,急。。。。。。。。。。。。
- 关于登陆PL/SQL Developer oracle的问题?急!急!急!急!
- 如何使表中某一字段在插入数据时自动增加,删除数据时自动减少
- 关于系列的问题。
- 高人请指教:监听器怎么也启动不了?试了好多方法,具体请看内容!
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