MySQL Forums
Forum List  »  Newbie

complex query: help needed
Posted by: jon benson
Date: August 08, 2006 11:03PM

have a database for holding music for different users that has 3 tables:

"artists"
artistID | artist



"titles"
titleID | title | artistId



"rel_users_titles"
userID | titleID | playcount



I want a query that selects the average playcount for artists (i will refer to as APA), given a particular user. For example, if i had a user that had 12 'Radiohead' tracks, and the combined playcount for all those tracks was 96, the APA for Radiohead would be 8. The query im looking for is something along the lines of "SELECT * FROM artists, titles, rel_users,titles WHERE userID=23 and APA>5." I am rather new to databases and have no idea how (or if) such a query can be done. Any help is appreciated.

Options: ReplyQuote


Subject
Written By
Posted
complex query: help needed
August 08, 2006 11:03PM
August 09, 2006 12:07PM
August 09, 2006 02:56PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.