I am learning SQL. Using MySQL, I am working on a very simple calendar application. SELECT statement below returns a relation with the schedule ID. And I'd like to delete it using the DELETE statement. So I am trying to delete a specific schedule only in schedule table. But I am getting a syntax error.
ERROR 1064 (42000): You have an error in your SQL syntax;
SELECT s.id
FROM schedule s, meetings m
WHERE m.date = s.date AND m.time = s.time AND m.id = 1;
// returns 5
DELETE
FROM schedule s, meetings m
WHERE m.date = s.date AND m.time = s.time AND m.id = 1;
// trying to delete the row with id=5 but syntax error
Please help.