日期:2014-05-18 浏览次数:20653 次
select a.id,a.name,count(*) [count] from t1 a inner join t2 b on a.id=b.sign where a.pt=10 group by a.id,a.name
------解决方案--------------------
inner join ==>改為left join即可
------解决方案--------------------
将inner join改为left join即可.
------解决方案--------------------
select a.id,a.name,ISNULL(count(b.sign),0) [count] from t1 a left join t2 b on a.id=b.sign where a.pt=10 group by a.id,a.name