plaverty Posted October 31, 2008 Share Posted October 31, 2008 But I'm not sure where. I know a little SQL, but not enough to debug this statement: delete from employee_shift es where concat(es.shift_id,es.semester) not in (select concat(shift_id,semester) from shifts); The error message is pointing at the where clause through the second concat call. This is MySQL 4.1.14 that I'm running it against. Thank you. Link to comment https://forums.phpfreaks.com/topic/130905-solved-getting-a-syntax-problem/ Share on other sites More sharing options...
Barand Posted October 31, 2008 Share Posted October 31, 2008 try join DELETE employee_shift.* FROM employee_shift es LEFT JOIN shifts s USING (shift_id, semester) WHERE s.shift_id IS NULL Link to comment https://forums.phpfreaks.com/topic/130905-solved-getting-a-syntax-problem/#findComment-679592 Share on other sites More sharing options...
plaverty Posted November 4, 2008 Author Share Posted November 4, 2008 Thank you, that worked. However there is a bug in MySQL that I found documented that doesn't allow for the table alias in that situation. Once I removed the es from the query, it worked great. Thank you. Link to comment https://forums.phpfreaks.com/topic/130905-solved-getting-a-syntax-problem/#findComment-682048 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.