A few days before mysql cross-Table deletion, I wrote a summary of Mysql cross-Table update. Today we will look at cross-Table deletion. After www.2cto.com and Mysql4.0, mysql began to support cross-Table delete. Mysql can delete multiple table records in an SQL statement at the same time, or delete records in a table based on the relationship between multiple tables. Suppose we have two tables: The Product table and the ProductPrice table. The former has the basic information about the Product, and the latter has the price of the Product. The first cross-Table deletion method is to delete multiple tables without the need for join operations. During the DELETE operation, multiple tables are separated by commas (,). The following SQL statement is used: delete p. *, pp. * FROM product p, productPrice pp WHERE p. productId = pp. productId AND p. created <'1970-01-01 'the second method of cross-Table deletion is to use inner join to specify the association between the two tables in join. The following SQL statement is used: DELETE p. *, pp. * FROM product p inner join productPrice pp ON p. productId = pp. productId WHERE p. created <'1970-01-01 'Note: you do not have to delete data from all tables for cross-Table deletion. The preceding SQL statement table deletes data from both the Product and ProductPrice tables, but you can specify DELETE product. * only records in the product table are deleted, and records in the ProductPrice table are not processed. You can also use left join for cross-Table deletion. For example, we want to delete all the Product table records that are not recorded in the ProductPrice table. The following SQL statement: DELETE p. * FROM product p left join productPrice pp ON p. productId = pp. productId WHERE pp. productId is null cross-Table deletion is very useful. Use it as needed.