Delete from table where two of the three keys in another select
Your code is valid SQL but not in SQL-Server. They haven't yet implemented the syntax (a,b) IN ((1,11), (2,12), ...) or (a,b) IN (SELECT expa, expb....).

You can work around with either an EXISTS subquery:

DELETE FROM tableA AS a
WHERE EXISTS
      ( SELECT 1
        FROM tableA AS b
        WHERE b.IDA = a.IDA AND b.IDB = a.IDB 
        HAVING COUNT(*) &gt; 1
      ) 
  AND a.comment = 'temp' ;


or probably more efficiently with a join:

DELETE a
FROM tableA AS a
  JOIN
    ( SELECT 
      FROM tableA 
      GROUP BY IDA, IDB
      HAVING COUNT(*) &gt; 1
   ) AS b
     ON  b.IDA = a.IDA AND b.IDB = a.IDB 
WHERE a.comment = 'temp' ;


and even better with a derived table or a cte (no self-join):

WITH dups AS
  ( SELECT comment, 
           cnt = COUNT(*) OVER (PARTITION BY IDA, IDB)
     FROM tableA 
  ) 
DELETE 
FROM dups
WHERE comment = 'temp' 
  AND cnt &gt; 1 ;