kingnutter Posted September 17, 2009 Share Posted September 17, 2009 This looks right to me, but it isn't working. I am trying to delete a row from table 'genrelinkcd' gl based on gl.moj_id and g.moj_genre from table 'genres'. genre_id is common to the two. Please could somebody help me with my syntax if they have a moment. Cheers, KN DELETE FROM genrelinkcd gl INNER JOIN genres g ON g.genre_id = gl.genre_id WHERE g.moj_genre = 'Alf' AND gl.moj_id = '211' Quote Link to comment https://forums.phpfreaks.com/topic/174558-solved-table-join-syntax-problem/ Share on other sites More sharing options...
kingnutter Posted September 17, 2009 Author Share Posted September 17, 2009 No worries. I've done it as a subquery: DELETE FROM genrelinkcd WHERE moj_id = 211 AND genre_id = (SELECT genre_id FROM genres WHERE moj_genre='Alf') Quote Link to comment https://forums.phpfreaks.com/topic/174558-solved-table-join-syntax-problem/#findComment-920028 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.