Anda dapat menghindari tabel sementara dan loopin mysql Anda dapat menghapus dua tabel dalam satu kueri dan menggunakan sunquery untuk data sementara
DELETE t1, t2
FROM AppCoverLetter t1
INNER JOIN (
SELECT AppId
FROM ApplyData.AppFormData
where lower(Email) = lower(_email_)
) t3 ON t1.AppID = t3.AppId
INNER JOIN AppError t2 ON t2.AppID = t3.AppId;
atau jika Anda memiliki lebih banyak meja
DELETE t1, t2, tx
FROM AppCoverLetter t1
INNER JOIN (
SELECT AppId
FROM ApplyData.AppFormData
where lower(Email) = lower(_email_)
) t3 ON t1.AppID = t3.AppId
INNER JOIN AppError t2 ON t2.AppID = t3.AppId
INNER JOIN table3 tx ON tx.AppID = t3.AppId;