DELETE FROM programSchedule
LEFT JOIN program ON programSchedule.pid = program.id
WHERE program.channel_id = 10
I get this error:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LEFT JOIN program ON programSchedule.pid = program.id' at line 1
Why?
You need to specify what table to delete from.
DELETE programSchedule.*
FROM programSchedule LEFT JOIN program ON programSchedule.pid = program.id
WHERE program.channel_id = 10
Note: Change the join to a INNER JOIN
since you are filtering by program.channel_id
DELETE programSchedule.*
FROM programSchedule INNER JOIN program ON programSchedule.pid = program.id
WHERE program.channel_id = 10
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With