I am trying to delete rows if new_id
column value is equal to 2 from multiple mysql tables, but I don't know if all those tables have column new_id
.
I try the following statement, but it gives a syntax error:
DELETE FROM table_name WHERE new_id =2 IF EXISTS new_id int(11)
How to do this?