Some SQL please?

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

revbob
Posts: 22
Joined: Wed Feb 22, 2006 10:44 am
Location: Decatur AL, USA
Contact:

Some SQL please?

Post by revbob »

I've really struck out on understanding the database. I've been banging on this for a couple of hours, and I suspect I'm not even close. Could somebody please post a line of VBScript that generates an iterator over all the songs whose Composer isn't blank, and that contains artist, album, song, and genre?

Thanks very much.
onkel_enno
Posts: 2153
Joined: Fri Jan 14, 2005 1:45 am
Location: Germany
Contact:

Post by onkel_enno »

Code: Select all

SQLSelect = "SELECT Songs.SongTitle, Artists.Artist, Albums.Album, Genres.GenreName"
SQLFrom   = "FROM ((Songs LEFT JOIN Albums ON Songs.IDAlbum = Albums.ID) LEFT JOIN Artists ON Songs.IDArtist = Artists.ID) LEFT JOIN Genres ON Songs.Genre = Genres.IDGenre"
SQLWhere  = "WHERE Songs.Author <> '' "

Set Iter = SDB.DataBase.OpenSQL(SQLSelect & " " & SQLFrom & " " & SQLWhere)
Should work, but didn't test.
Last edited by onkel_enno on Mon Feb 27, 2006 4:26 am, edited 1 time in total.
revbob
Posts: 22
Joined: Wed Feb 22, 2006 10:44 am
Location: Decatur AL, USA
Contact:

Thank you

Post by revbob »

Thanks very much. That's got me unstuck.
Post Reply