I have a query that runs quickly without the is null
parameter in the Where clause, but when I add it back in it takes more than 10 minutes to run.
SELECT
Parent_FRID, Name, lvl2desc, capyr, crpprjamt, empprjamt,
othprjamt AS Other_Projected, Fcrprepamt, Femprepamt, Fothrepamt, NFcrprepamt,
NFemprepamt, NFothrepamt, crpamt, empamt, othamt, Audited, Previous_Corp_Amt,
Previous_Emp_Amt, Previous_Total_Projected, Previous_Total_Reported,
Previous_Audited, crpfnl, empfnl, othfnl
FROM
Camp_Sum_6_Current_14
WHERE
cnttyp IS NULL AND
lvl2 <> '1020' AND
doncls in ('AG','CO')
I have tried everything and I can't get it figured out. I tried a subquery. I tried changing the Null values to 'None' in the original table. The same query runs fine with is not null.