You can see an example of a hacked version at http://db.etree.org/users.php
My desired sql, which is incorrect sql, would be:
select userid, count(ref_artist = 1) as c1, count(ref_artist = 2) as c2, from shows, myshows where ref_shows = myshows_key group by ref_artist order by userid
So my tables:
myshows
userid
ref_shows
shows
shows_key
ref_artist
Hope that helps define the question better,
Tom