有一表a     字段             a.dir   ,... 
  数据如下                      1               
                                1/01 
                                1/01/1 
                                1/02 
                                2 
                                。。。 
  表b           字段           b.dir,           b.class 
  数据如下                      1/01           b 
                                1/01           bb 
                                1/01/1       c 
                                1/01/1       cc 
                                1/01/1       cd 
                                1/02           e 
                                2                 f 
                                。。。 
  
求出对应a表每行对应b表的数据和,如下 
  
                dir               count 
                                1                   6 
                                1/01             5 
                                1/01/1         3 
                                1/02             1 
                                2                   1 
  


select   a.dir,[count]=count(b.class) 
  from   表a     a   join   表b   b   on   b.dir   like   a.dir+'%' 
  group   by   a.dir