title: Group By clause causing error
body: <p>So here is the context : Developping an ASP.NET MVC 4 web app, I have in my database a table <strong>ProductAllocations</strong> which is composed of 2 foreign keys : one from my table <strong>Products</strong> and the other from the table <strong>Persons</strong>. I have another table, <strong>Vehicles</strong> which contains a foreign key of the table <strong>Products</strong></p>
  
  <p>I want to select the allocations and their information grouped by a product (a product can be allocated several time). Here is my stored procedure : </p>
  
  <pre><code>ALTER PROCEDURE GetAllVehicles
  
  AS
  
  BEGIN
  
      SET NOCOUNT ON 
  
      SELECT 
  
      p.FirstName,
      p.LastName,
      pa.EndDate,
      pr.PurchaseDate,
      pr.SerialNumber,
      pr.CatalogPrice,
      v.PlateNumber,
      v.FirstCirculationDate,
      V.FirstDrivingTax,
      v.UsualDrivingTax
  
      FROM bm_ProductAllocations AS pa
  
      INNER JOIN bm_Persons AS p ON pa.Id_Person = p.Id_Person
      INNER JOIN bm_Products AS pr ON pa.Id_Product = pr.Id_Product
      INNER JOIN bm_Vehicles AS v ON pr.Id_Product = v.Id_Product
  
      GROUP BY pa.Id_Product
  
  END
  </code></pre>
  
  <p>However, the Group By clause is generating an error : <code>Column 'bm_Persons.FirstName' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.</code> I'm working with Visual Studio 2010.</p>
  
  <p>I'm new to SQL so I have no idea about what's going on.</p>