title: Select and Group by together
body: <p>I have my query like this:</p>
  
  <pre><code>Select 
    a.abc,
    a.cde,
    a.efg,
    a.agh,
    c.dummy
    p.test
    max(b.this)
    sum(b.sugar)
    sum(b.bucket)
    sum(b.something)
  </code></pre>
  
  <p>followed by some outer join and inner join. Now the problem is when in group by </p>
  
  <pre><code>group by 
    a.abc,
    a.cde,
    a.efg,
    a.agh,
    c.dummy,
    p.test   
  </code></pre>
  
  <p>The query works fine. But if I remove any one of them from group by it gives:  </p>
  
  <pre><code>SQLSTATE: 42803
  </code></pre>
  
  <p>Can anyone explain the cause of this error?</p>