求一条group by的sql
detailTable表 
 id         categoryid               severityId      name 
 1            1                                          1                                 name1 
 2            1                                          2                                 name2 
 3            1                                          3                                 name3 
 4            2                                          1                                 name4 
 5            2                                          2                                 name5   
 categoryInfoTable 
 categoryid            cate_name         cate_details       
 1                                       cate1                     descripion1    
 1                                       cate2                     descripion2   
 最后要求 
 categoryid         count      cate_name      cate_details 
 1                                    3                  cate1                  descripion1    
 2                                    2                  cate2                  descripion2   
 我的想法是       
 select      categoryid,sum(*)   ,(   ?   )   from   detailTable   group   by   categoryid    
 就是问号这里能   有什么好的sql实现嘛。
------解决方案--------------------select a.categoryid,count(b.categoryid),a.cate_name,a.cate_details 
 from categoryInfoTable a,detailTable b 
 where a.categoryid=b.categoryid 
 group by a.categoryid,a.cate_name,a.cate_details