facil, tu fais une jointure
A = select id, count(id) c from table a, table b, where a.id >= b.id groupby a.id
ceci te donne une association id->nbdechampsplusgrand, il ne te reste qu´a faire une restriction dessus
select id from A where c < 20;
on peut encore l´ecrire:
select id from table a, table b where a.id >= b.id groupby a.id having count < 20
(a la syntaxe pres peut etre)