Forum Moderators: coopster
how can i count(sum) the number of instances of each keyword_id, and output the number of times each occurs with another when associated with a given artist_id?
i.e
3= 1 instance
14= 2 instances
etc
54= 3 instances
and
54 with 10 = 1 instances
54 with 9 = 1 instances
etc
eventually
so
54, 10, 9, 106 = 2 instances
3, 7, 8, 19 = 14 instances
i am using mysql and php for a digital sound art project
any ideas?
thanks
This is getting a bit beyond my SQL skills but here is an attempt for you -
"SELECT artist_id, keyword_id, COUNT(*) FROM table tbl, table tbl1 WHERE tbl.artist_id = tbl1.artist_id AND tbl.keyword_id = tbl1.keyword_id GROUP BY artist_id;"