I am having some trouble with a SQL delete. SQL Server doesn’t like have multiple parameters in the where clause to delete rows from table_02 (subquery is table 1). Any help on this would greatly be appreciated.
thanks.
DELETE FROM table_02
WHERE (col_1,col_2,col_3,col_4)
IN (
SELECT col_1,col_2,col_3,col_4
FROM table_01
GROUP BY
col_1,col_2,col_3,col_4
HAVING SUM(CASE WHEN col_1<6 THEN col_2*-1 ELSE col_2 END)=0
)
You can rewrite
INas anEXISTS