日期:2014-05-17 浏览次数:20876 次
-- Created on 2012-5-5 by ADMIN declare CURYEAR VARCHAR(4); CURSEA VARCHAR(1); begin -- Test statements here CURYEAR := '2012'; CURSEA := to_char((sysdate+interval'-1' day),'q'); --- 1/2/3/4 UPDATE t_report_bfsshouru T SET T.SEASON0 = 9999.999, T.SEASON1 = (SELECT SUM(S.REALPAYRMB) FROM T_INIT_BFSHOURU S WHERE S.VY='2012' AND S.VSEASON = '2'), T.SEASON2 = (SELECT SUM(S.REALPAYRMB) FROM T_INIT_BFSHOURU S WHERE S.VY=CURYEAR AND S.VSEASON = CURSEA) where T.Qdtype='AL' AND T.STATUS=1; dbms_output.put_line(SEASON2 ->> SELECT SUM(S.REALPAYRMB) FROM T_INIT_BFSHOURU S WHERE S.VY='||CURYEAR ||' AND S.VSEASON = '||CURSEA); end;