You can use window functions:
SELECT comptitle, trknum, cdtitleFROM (SELECT comptitle, trknum, cdtitle, COUNT(*) OVER (PARTITION BY comptitle) as cnt FROM track t JOIN recording r ON t.rcdid = r.rcdid JOIN composition c ON r.compid = c.compid JOIN cd ON cd.cdid = t.cdid ) tWHERE cnt >= 2ORDER BY cnt, comptitle;