你這裡要到自己Table裡取自己的Count,這是肯定要這一條子查詢的,
不過一定要也不是不行,只是效率會更低----
select count(a.pertainempID)as geshu,b.id,b.EmpUserName,b.Empaccounts,b.credit,b.Sdate,s.state 
from tb_employee a,tb_employee b,employeestate s
where s.id=b.Empstate and a.pertainempID=b.id and b.pertainempID=2
group by b.id,b.EmpUserName,b.Empaccounts,b.credit,b.Sdate,s.state