我需要计算以下查询返回的行数.
select m.Company_id from Monitor as m inner join Monitor_Request as mr on mr.Company_ID=m.Company_id group by m.Company_id having COUNT(m.Monitor_id)>=5
我已经尝试过跟随
select COUNT(*) from ( select m.Company_id from Monitor as m inner join Monitor_Request as mr on mr.Company_ID=m.Company_id group by m.Company_id having COUNT(m.Monitor_id)>=5)
Msg 102,Level 15,State 1,Line 7 Incorrect Syntax near ‘)’.