Count(*) in Delete statement
Your query wants to delete all the rows in table1 where the value of c is n.

Simply modify the DELETE statement so it no longer mentions the COUNT(*) &gt; 0, since that doesn't change the semantics of the query at all.

DELETE
FROM table1
WHERE c = 'n';