select a.id,a.title,count(id) as hint from a,b 
           where a.id=b.id group by a.id,a.title

解决方案 »

  1.   

    select a.title,count(a.id) as hint from a,b 
               where a.id=b.id group by a.id,a.title
      

  2.   

    或select a.title,count(id) as hint from a,b 
               where a.id=b.id group by a.title
      

  3.   

    select a.title,count(hint) as hint from a,b 
               where a.id=b.id group by a.title
      

  4.   

    或:
    select title,(select count(*) from b where id=a.id) hint from a