bookmark

Multi-Table Deletes (MySQL :: MySQL 5.7 Reference Manual :: 13.2.2 DELETE Syntax)


Description

For example, to delete rows that exist in t1 that have no match in t2, use a LEFT JOIN:

DELETE t1 FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE t2.id IS NULL;

Preview

Tags

Users

  • @schmidt2

Comments and Reviews