Mysql从两个表中删除查询

时间:2016-06-26 15:44:53

标签: mysql sql-delete

您好我已写删除查询

delete installments . InstallmentID , Installment_part . InstallmentID  , Installment_part.Parts_ID ,Installment_part.*  FROM installments
    INNER JOIN
Installment_part ON installments.InstallmentID = Installment_part.InstallmentID 
WHERE
(((installments.InstallmentID) = 7)
AND ((Installment_part.InstallmentID) = 7));

它给我这个错误未知表InstallmentID 我已将其更改为Select Statement,它会显示我想要删除的内容

1 个答案:

答案 0 :(得分:0)

DELETE im.*,imp.* FROM installments im
    INNER JOIN
Installment_part imp ON im.InstallmentID = imp.InstallmentID 
WHERE im.InstallmentID = 7;