-1

What's wrong in this statement? It is giving syntax error in mysql

delete 
from table1 t1 
left join table2 t2 on t1. Id=t2.id 
where t2.id is null

Please provide your suggestions

GarethD
  • 68,045
  • 10
  • 83
  • 123
Sri
  • 11

1 Answers1

1

When joining you need to specify from which table(s) you want to delete

delete t1
from table1 t1 
left join table2 t2 on t1.Id = t2.id 
where t2.id is null
juergen d
  • 201,996
  • 37
  • 293
  • 362