日期:2014-05-19  浏览次数:20423 次

帮我看看这句SQL为什么不好用
SELECT   count(*)   as   num   FROM   HIS_User   where   JobType= '1 '   and   CompanyID   in   (select   CompanyID   from   HIS_Company   where   CompanyType= '1 ')


------解决方案--------------------
SELECT count(1) as num FROM HIS_User where JobType= '1 ' and CompanyID in (select CompanyID from HIS_Company where CompanyType= '1 ')
------解决方案--------------------

group by JobType,CompanyID

分组看一下 各自的数量