spool导出实例 .增加帐户记录 spool /home/mocsa/subsid_addmoneycsv select tsubsidtacctidsum(ttransmoney) from T_ACCTWATER t where (trunc(tTRANSTIMEdd) between trunc(to_date(yyyymmdd)dd) and trunc(to_date(yyyymmdd)dd) ) and tTRANSTYPE = and tREPENISHCHANNEL = and tsubsid in( select SubsId from T_ACCTWATER where (trunc(TRANSTIMEdd) between trunc(to_date(yyyymmdd)dd) and trunc(to_date(yyyymmdd)dd) ) and TRANSTYPE = and REPENISHCHANNEL = group by SubsId having sum(TRANSMONEY)>) group by tsubsidtacctid; spool off; |