select code,patientsname,patientdepartmentname,amount,day from(
select code,patientsname,patientdepartmentname,amount ,day from tb_hos_outpatientcharges where feetype=1 union all
select recordcode as code,patientname as patientsname,recorddeptname as patientdepartmentname,money as amount,recordtime as day from tb_hos_in_hosfee where feetype=1
)
这个是查询两张表中记账的数据.现在要将同村镇的欠账钱数相加.插入统计表中..而且欠账钱数每天都会增加新的,怎么累加到统计表中?..求高手指教.
select code,patientsname,patientdepartmentname,amount ,day from tb_hos_outpatientcharges where feetype=1 union all
select recordcode as code,patientname as patientsname,recorddeptname as patientdepartmentname,money as amount,recordtime as day from tb_hos_in_hosfee where feetype=1
)
这个是查询两张表中记账的数据.现在要将同村镇的欠账钱数相加.插入统计表中..而且欠账钱数每天都会增加新的,怎么累加到统计表中?..求高手指教.
解决方案 »
- 关于触发器的一个错误
- 关于重复项多的下拉菜单建children_id的问题
- 关于触发器??谢谢!
- Oracle81密码
- Oracle Developer
- vc ado + oracle 开发 ,一次入2G 数据到一半数据量时客户端cpu利用率100% 就不再入数据了,在线等。。急。。。
- 为什么不能启动OracleOraHome90Agent服务
- 怎么样对ORACLE中的存储过程及包加密?加密后又怎么样在前台程序中调用?
- 怎么把带有数字,英文字母和符号的行挑出来?
- 请教各位大神一个sql面试题,关于where子查询的,我看不懂啊,求教!!
- SQL Server 2005数据移植到Oracle11g
- 新手拜山,想了解下用SQL如何获得时区信息后转换成数字类型的
1 123 陈彬 丁桥 100 2011-06-13
2 141 陈彬 蓉城镇 10 2011-06-13
3 201 陈彬 杜村 5 2011-06-03
4 301 方世玉 城东乡 80 2011-06-14
5 302 李斯 丁桥 80 2011-06-14
6 81 张三 杜村 231 2011-06-02
7 41 张三 33 2011-05-26
8 102 李四 酉华 500 2011-06-13
9 82 张三 丁桥 36 2011-06-02
10 40 张三 王圩村 33 2011-05-26
11 101 李四 酉华 300 2011-06-13