摘要:
1.尽量不要在where中进行计算,尤其是需要遍历的情况原来代码,执行大约40秒INSERT INTO @TransferCode ( PROXY_NO, TING_NO, WTotal, BTotal ) SELECT H.PROXY_NO, H.TING_NO, SUM(CASE WHEN H.CARDTYPE='W' THEN CASE WHEN (B.DDATE='' AND B.DTIME='') THEN 0 WHEN B.BCHIPEX='10' THEN -B.BCHIP ELSE B.BCHIP END EL.. 阅读全文