日期:2014-05-17 浏览次数:20866 次
MERGE INTO CR_CS_CSOKPIBASE A USING (SELECT COUNT(F_KEY) AS SUM_QTY, F_ASPNODE FROM CR_CS_CSOKPIBASE WHERE F_SERVICETYPE <> 9 AND F_SERVICETYPE <> 11 AND F_SERVICETYPE <> 12 AND F_INTERNALCLOSETIME >= TO_DATE('2012-06-27 00:00:00', 'yyyy-mm-dd hh24:mi:ss') AND F_INTERNALCLOSETIME <= TO_DATE('2012-07-26 23:59:59', 'yyyy-mm-dd hh24:mi:ss') GROUP BY F_ASPNODE) B ON (A.F_ASPNODE = B.F_ASPNODE) WHEN MATCHED THEN UPDATE SET A.F_ASPNODETOTALCSOQTY = B.SUM_QTY;
------解决方案--------------------
补充一点:如果 F_INTERNALCLOSETIME 不是 date 类型,那么 不用加 to_date,保持原样就可以。