declare @t table(uid int,content char(10),hfid int)
insert @t
select 1,'...',0 union all
select 2,'...',0 union all
select 3,' ...',1 union all
select 4,' ...',1 union all
select 5,' ...',2
select *,
(select count(*) from @t where hfid = a.uid) as count
from @t a
where hfid = 0/*uid         content    hfid        count       
----------- ---------- ----------- ----------- 
1           ...        0           2
2           ...        0           1(所影响的行数为 2 行)
*/