I have two (simplified) tables in a database.
Table: queuelist
'songID', 'lastplayed'
'7376', '12/01/2013'
'9322', '16/08/2012'
Table: songlist
'ID', 'artist'
'7376', 'Michael Jackson'
'2345', 'Nirvana'
'songID'
and 'ID'
are the same fields.
I'm given 'Michael Jackson'
as an input and I want to delete the first row in 'queuelist'
based on looking up 'ID'
as the common field. I'm a MYSQL noob and have been trying examples but so far don't quite follow the syntax.
So far I have this...
DELETE S.songID
FROM queuelist Q,
(
JOIN songlist S
ON Q.songID = S.ID
)
WHERE S.artist = 'Michael Jackson'