select count(*) from (select label_A,LABEL_B from TABLE where LABEL_B='ABC' group by label_A,LABEL_B) as count;
shows a count on a inner select.