title: Group function not working on SQL server
body: <p>I use the below query, but it shows some repeated items. So I use the <code>group</code> function, but it does not work.</p>
  
  <pre><code>SELECT p.productId, p.productName, p.catId, p.subCatId, p.productType,
         p.modelNo, p.picUrl, p.color, p.theme, p.productPrice, p.discountedPrice,
         p.quantity, p.details, p.mainPageDisplay, p.productPageDisplay,
         s.subCatId AS Expr1,
         s.subCatName, s.catId AS Expr2,
         s.rank, s.subCatName AS Expr3
  FROM (products p INNER JOIN
        subCategories s ON p.catId = s.catId)
  WHERE (p.color = 'red') group By p.productName
  </code></pre>
  
  <p>This query is working fine, but when I add <code>group by</code> then it's not working.</p>