sql语句中如何分组显示模糊查询出的记录数?

2024-11-28 21:19:57
推荐回答(1个)
回答1:

直接用count就可以了,这样:
select COUNT(*) AS CNT
from tableA as a,tableB as b,table C as c
where a.id=b.typeid and b.addid=c.id
group by b.id,b.name,c.address,a.type
但是你怎么还要用group BY呢?如果只是满足where条件的总数的话,就要去掉group by