Is there anything wrong with this statement? It gives syntax error: delete from table1 t1 left join table2 t2 on t1. Id=t2.id, where t2.id is empty
P粉148434742
P粉148434742 2023-09-05 20:04:37
0
1
586
<p>Is there anything wrong with this statement? Syntax error occurred in mysql</p> <pre class="brush:php;toolbar:false;">delete from table1 t1 left join table2 t2 on t1. Id=t2.id where t2.id is null</pre> <p>Please give us your suggestions</p>
P粉148434742
P粉148434742

reply all(1)
P粉798343415

When joining, you need to specify which table you want to delete from

delete t1
from table1 t1 
left join table2 t2 on t1.Id = t2.id 
where t2.id is null
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template