I have 2 tables - a Tune table and a an Artist table. Tune contains a list of tunes and each tune has an ArtistID. What I want to do it total up the tunes for each artist and then update the Artist table with those values. I cannot get my SQL to work.
This is what I have so far:
UPDATE Artist
SET
TuneCount=c
FROM
(
SELECT ArtistID AS a, COUNT() AS c
FROM Tune
GROUP BY ArtistID
)
--WHERE _id=a
Can somebody please help me? SQLite doesn't seem to like the first FROM keyword.