In mySQL I have two tables (course and section) and I want to delete all sections that are 1 credit and on Mondays. The course table has the credits for the course and the section table has the days for that section of the course. Here's what I have for my query but I get errors:
DELETE FROM
section
WHERE
course_ID
IN (
SELECT course_ID
FROM course
NATURAL JOIN section
WHERE credits = '1'
AND days LIKE '%M%'
);
Can anyone help with this?
could you have a same table exception for table section
for avoid this so you could try using a join on a subquery instead of IN clause