(1) select a.tno,b.tname,a.cname from B a inner join (select tno,tname from A where tname like '王%') b no=b.tno order by a.cname ASC;
(2)select b.tname,a.tno,a.count from (select tno,count(*) count from B group by tno) a right join A b on a.tno=b.tno;