spool导出实例
点击次数:35 次 发布日期:2008-11-22 16:40:44 作者:源代码网
|
源代码网推荐
spool导出实例:
1. 增加帐户记录: spool /home/mocsa/subsid_addmoney1.csv select t.subsid,t.acctid,sum(t.transmoney) from T_ACCTWATER t where (trunc(t.TRANSTIME,"dd") between trunc(to_date("20070929","yyyymmdd"),"dd") and trunc(to_date("20071016","yyyymmdd"),"dd") ) and t.TRANSTYPE = 11 and t.REPENISHCHANNEL = "307" and t.subsid in( select SubsId from T_ACCTWATER where (trunc(TRANSTIME,"dd") between trunc(to_date("20070929","yyyymmdd"),"dd") and trunc(to_date("20071016","yyyymmdd"),"dd") ) and TRANSTYPE = 11 and REPENISHCHANNEL = "307" group by SubsId having sum(TRANSMONEY)>10000) group by t.subsid,t.acctid; spool off;
源代码网供稿. |