...does the same thing:
select h.calldatetime, h.crc, h.projname, h.phonenum from dbo.history h
WHERE ProjName IN ('sss' , 'mmm')
AND (SELECT Count(*) FROM history WHERE CRC = 'ERROR' and phonenum = h.phonenum HAVING Count(*) > 2) > 2
AND (CallDateTime between dateadd(mi, -130, GetDate()) and...