select supe_spaceitems1.subject,count(*) from supe_spaceitems as supe_spaceitems1 ,supe_spaceitems as supe_spaceitems2 where supe_spaceitems1.itemid!=supe_spaceitems2.itemid and supe_spaceitems1.subject=supe_spaceitems2.subject group by supe_spaceitems1.subject;