Quote Originally Posted by PAVB
I probably missed something but at first glance I would do...
Code:
select   cid         "Clones", 
         count(*)    "Genes"
from     thetablewhereyourddatais
group by cid
order by cid;
As long as the cid, gid columns are unique in the table where aph is running the query, then your answer is correct. I just wrote it so that it would not matter if they were unique or not.