select a.t_id,a.t_name,a.t_other,b.count from t a inner join
(select t.t_id,isnull(count(*),0) as count
from t,s where t.t_id=s.t_id
group by t.t_id) as b
on a.t_id=b.t_id
抄袭,请原谅。
select a.t_id,a.t_name,a.t_other,b.count from t a inner join
(select t.t_id,count(*) as count
from t,s where t.t_id=s.t_id
group by t.t_id) as b
on a.t_id=b.t_id