I need help. how can I convert this MySQL query count into MsSQL query
SELECT patientmasters.ID,
patientmasters.HRN,
patientmasters.LastName,
patientmasters.FirstName,
patientmasters.MiddleName,
 count(casehistories.PatientID) as NumberOfRecords        
from patientmasters
left join casehistories
on (patientmasters.ID = casehistories.PatientID)
group by
    patientmasters.ID;
 
     
    