I'm trying to do a query which is way beyond my usual sql statements and I'm not sure what to use.
I have 3 tables
Songtable (fields - ID,Songname,ArtistID)
SongPaid (fields - SongID,CustID)
ArtistTable (fields - ID, ArtistName)
So what I want to do is look into the "SongPaid" table and see which customers bought that song. The table stucture
SongID CustID
246 312
231 312
133 312
133 345
23 312
23 412
677 412
then look at other customers who bought that track or artist and see what they bought
so for example the song 23 was bought by customers 312 and 412 - who also bought songID 246,231,133 and 617, which are by the artist, find that from songtable.artistid
I need some way of doing this comparison in the songpaid table.
I have 3 tables
Songtable (fields - ID,Songname,ArtistID)
SongPaid (fields - SongID,CustID)
ArtistTable (fields - ID, ArtistName)
So what I want to do is look into the "SongPaid" table and see which customers bought that song. The table stucture
SongID CustID
246 312
231 312
133 312
133 345
23 312
23 412
677 412
then look at other customers who bought that track or artist and see what they bought
so for example the song 23 was bought by customers 312 and 412 - who also bought songID 246,231,133 and 617, which are by the artist, find that from songtable.artistid
I need some way of doing this comparison in the songpaid table.