title: Select query it is not contained in either an aggregate function or the GROUP BY clause
body: <p>I am getting this error:</p>
  
  <blockquote>
    <p>Msg 8120, Level 16, State 1, Procedure ReportEmployeesOnLeave, Line 17
    Column 'Employee.EmployeeId' is invalid in the select list because it
    is not contained in either an aggregate function or the GROUP BY
    clause.</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/BSc0O.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BSc0O.jpg" alt="enter image description here"></a></p>