title: using group by clause in subquery in sql
body: <p>I am trying to use group by clause in subquery which is in from clause</p>
  
  <pre><code>select userID,count(id) 
  from 
  (
      (
          select id,max(bidAmount),userID 
          from Bids 
          group by id,bidAmount
      ) 
      group by userID
  );
  </code></pre>
  
  <p>but this gives error</p>
  
  <blockquote>
    <p>Error: near "group": syntax error</p>
  </blockquote>
  
  <p>Is it possible to use group by clause in subquery in from clause in sql?</p>