Some SQL please?

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Some SQL please?

Thank you

by revbob » Mon Feb 27, 2006 3:57 am

Thanks very much. That's got me unstuck.

by onkel_enno » Mon Feb 27, 2006 3:29 am

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.

Some SQL please?

by revbob » Mon Feb 27, 2006 1:31 am

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.

Top