日期:2014-05-17  浏览次数:20585 次

关于强制HASH语句报错,100分,解决马上给
问题描述,我在做SQL语句优化的时候发现使用HASH匹配,当时没有报错,可能条件不一样,,运行了一段时间发现报如下错误

SELECT  COUNT(*)
FROM    vcb_ContractGrid
        LEFT JOIN ( SELECT DISTINCT
                            BusinessGUID
                    FROM    vjd_Work2Business
                    WHERE   Type = '合同'
                            AND BeginDateJh != ConfirmedBeginDate
                  ) b ON vcb_ContractGrid.ContractGUID = b.BusinessGUID
WHERE   vcb_ContractGrid.BUGUID = ( '993dcc44-7297-415f-9f4a-6c87e7f49387' )
        AND vcb_ContractGrid.IfDdhs = 1
        AND vcb_ContractGrid.IfConfirmFkPlan = 0
        AND vcb_ContractGrid.JbrGUID = ( '39957769-229b-442e-b839-7ff710433c17' )
        AND ( (( ( 1 = 1
                   AND ( JbDeptCode = 'zb.c1006'
                         OR JbDeptCode LIKE 'zb.c1006.%'
                       )
                 )
                 AND ( 1 = '1' )
               )
              AND ( 88 = 88 ))
            )
        AND ( ( vcb_ContractGrid.ContractGUID IN (
                SELECT  cb_ContractProj.ContractGUID
                FROM    cb_ContractProj
                        INNER HASH  JOIN ( SELECT    ContractGUID
                                          FROM      cb_Contract2HTType aa