求一SQL语句
表A
Aid Aname ANum
1 贵州 1
2 北京 2
3 上海 3
表B
Bid Bname Bclass
1 张燕 1
2 王海 1
3 陈磊 2
4 汪峰 3
求
查询Aname 计算当Bclass=Anum时有多少个Bclass=Anum
应该怎么写?
------解决方案--------------------select count(b.Bid) from a,b where a.ANum=b.Blcass and a.ANum=值
------解决方案--------------------select count(*) from TA,TB where TA.ANum=TB.Bclass
------解决方案--------------------try
--------------------------------------------
select count(A.Aid) as TR1,A.Aname as name1
from A
left join B onA.Anum=B.Bclass group by A.Aname
------解决方案--------------------