title: Exculde Columns on Group BY
body: <p>I have a query below my only problem is to exclude some column in the group by clause.</p>
  
  <pre><code>SELECT * FROM OPENQUERY
  (server, 
  ''select 
      b.devdate as DevDate,   
      c.devWidth AS DevWitdh,
      c.devHeight as DevHeight,
      a.devQty AS DevQTY,     
      c.devCode AS DevCode,
      d.devdesk AS DevDesc,
  
   from 
      server.a_STAT a,
      server.a_cust b,
      server.a_post c,
      server.dev_date d,
      server.a_adress e
   where 
         a. DevQTY!=0 and a.AUF_NR=b.AUF_NR and a.auf_pos = c.auf_pos AND
         b.AUF_NR=c.AUF_NR AND 
         b.AUF_OFF = 0 AND  
         d.idnr=  c.GLAS1  AND    
         b. dev_date ''''' + @DTFrom + ''''' AND '''''+ @DTTo+'''''   '
  
  
  SET @ENDTSQLSTATEMENT1 =' GROUP BY b. dev_date,c.GLAS1, d.gl_bez, c. DevWitdh, c. DevHeight , a. DevQTY ORDER BY b. dev_date '' )'
  </code></pre>
  
  <p>In my select I want to add the Customer name and the Project but I don't want to include that in the group by clause. Please help me...</p>