I have created 3 tables: playlist, tracklist, & xmlexport, which I use for storing my playlists. To keep from duplicating any of the items in the playlist, I use a tracklist that I insert from the playlist & I insert the top row of my tracklist into my xmlexport which I then export the track to be played in the form of an .xml file to be read by my player. Each time this process happens I remove a row from the tracklist, so when the table plays the last item it becomes empty & I need to run a query to update the tracklist table from the playlist table. This is what I've been playing with but its not working properly.
INSERT INTO dms.test_trk
SELECT * FROM dms.test_ply
WHERE row_count() <= 0;