title: Group by in stored procedure
body: <p>I have tables for projects and members the main goal is one to many relationship.</p>
  
  <p>I have many projects and many members, now I have to find how many members that are assigned in a particular project (I have many tables in addition to these I didn't mention here but you can see in my stored procedure)</p>
  
  <pre><code>CREATE PROCEDURE [dbo].[SP_PROJECT_EMPLOYSSSS]
  (
    @Employee_ID INT
  )
  AS
  BEGIN
      SELECT E.Employee_ID, S.Project_Title, COUNT(E.First_Name) 
      FROM tbl_NEW_Employee AS E  
      INNER JOIN  tbl_NEW_Employee_Project AS K ON K.Employee_ID = E.Employee_ID 
      INNER JOIN dbo.tbl_NEW_Project AS S ON K.Project_ID = S.Project_ID 
      WHERE E.Is_Active=1 AND E.Employee_ID = @Employee_ID 
      Group BY E.First_Name
  END
  </code></pre>
  
  <p>I am new to programming and stored procedures.</p>
  
  <p>I am getting this error :</p>
  
  <blockquote>
    <p>Column 'tbl_NEW_Employee.Employee_ID' is invalid in the select list
    because it is not contained in either an aggregate function or the
    GROUP BY clause.</p>
  </blockquote>
  
  <p>Please help me to write this stored procedure using <code>GROUP BY</code> clause</p>