-1

I ran this query in mysql but it showed an error Unknown table 'table1' in MULTI DELETE. Can anyone guide me on what is wrong please?

DELETE table1, table2,table3, table4
from table1 as t1 
left join table2 as t2
on t1.id = t2.tid 
left join table3 as t3
on t1.id = t3.tid
left jointable4 as t4 
on t1.id = t4.tid 
where t1.id = 77
1

1 Answer 1

1

That's because when you use aliases in multiple delete then you must specify the aliases after DELETE statement:

DELETE t1, t2, t3, t4
from table1 as t1 
left join table2 as t2 on t1.id = t2.tid 
left join table3 as t3 on t1.id = t3.tid
left join table4 as t4 on t1.id = t4.tid 
where t1.id = 77

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.