1.oracle中查找列数
select count(*) from USER_TAB_COLUMNS where table_name ='TABLE_NAME';
//表名要大写
2.创建已经存在的表
create table xxxx as select * from yyyy;
3.两张关联表的统计
select r1.apply_id,r1.money_true,r2.money_return
from
(select ba.apply_id, sum(money_true) as money_true from base_apply ba,money_login ml where ba.apply_id = ml.apply_id group by ba.apply_id ) r1,
(select ba.apply_id, sum(return_money) as money_return from base_apply ba,money_return mr where ba.apply_id = mr.apply_id group by ba.apply_id ) r2
where r1.apply_id = r2.apply_id