Get the artist of a song in SQL

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

m0nkiii
Posts: 15
Joined: Mon Feb 26, 2007 1:48 pm
Location: Swiiiiden

Get the artist of a song in SQL

Post by m0nkiii » Thu Mar 01, 2007 9:00 pm

I'm going to update the PlayCounter of some songs and I have the following code:

Code: Select all

SDB.Database.ExecSQL( "UPDATE Songs SET PlayCounter= WHATEVER WHERE (Songs.SongTitle = WHATEVER and Songs.Artist = WHATEVER)")
But Songs.Artist won't work. Neither will Songs.ArtistName etc...
Help... :roll:

Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Post by Bex » Thu Mar 01, 2007 9:32 pm

Try this:

Code: Select all

SDB.Database.ExecSQL("UPDATE Songs INNER JOIN Artists ON Songs.IDArtist = Artists.ID SET Songs.PlayCounter = SomeNumber WHERE Songs.SongTitle = 'SomeTitle' AND Artists.Artist = 'SomeArtist' ")
The Artist name is store in the Artists table and not in the Songs table so you need to link the songs table to the Artists table. And don't forget to enclose text values with -> '
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts

m0nkiii
Posts: 15
Joined: Mon Feb 26, 2007 1:48 pm
Location: Swiiiiden

Post by m0nkiii » Fri Mar 02, 2007 5:43 am

Gött mos, Spanks !

I thought it was something like that but I couldn't get it to work :P

Post Reply