SQL

Delete Join SQL

안드로이 2023. 7. 4. 10:58

두개의 테이블에 연관된 데이터를 삭제하는 방법

 

delete t1, t2
from t1
inner join t2 on t1.id = t2.ref 
where t1.id =1;

아래 링크에 자세하게 설명되어 있음

 

https://www.mysqltutorial.org/mysql-delete-join/

 

MySQL DELETE JOIN: Deleting Data from Multiple Tables

This tutorial shows you how to delete data from multiple tables by using MySQL DELETE JOIN statement with INNER JOIN and LEFT JOIN.

www.mysqltutorial.org