有A(aid,cid,name) B(bid,cid,tt)两个表
我现在要查询aid,name,count. count是统计A.cid=B.cid并且tt='2'的个数
请问这个sql怎么写
我自己这样写的 但报ORA-00937: 不是单组分组函数 错误
select a.aid,a.name count(b.tt) from A a,B b where a.cid=b.cid and b.tt='2'
[b]问题补充:[/b]
group by 怎么写?
select 后接count函数
那么后面必须要有group by啊