title: Ordered Analytical Functions not allowed in GROUP BY Clause
body: <p>I have a query joining 2 tables with a SELECT statement for fields in both tables, and an Ordered Analytical Function to calculate the total volume for specific customers.
  I'm getting the error &quot;Ordered Analytical Functions not allowed in GROUP BY Clause&quot; when I try to group the fields. I need the GROUP BY because there are other fields that need to be grouped but I also need the SUM() OVER (PARTITION BY()) for other calculations. How can I create the subquery so as to get rid of the error?</p>
  <p>The query is something like this:</p>
  <pre><code>a.cust_no,
  b.cust_name,
  a.location,
  c.product,
  SUM(a.volume),
  SUM(a.weight),
  SUM(volume) OVER (PARTITION BY cust_no ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS fixed_volume, 
  SUM(CASE WHEN a_flag = 'Y' THEN volume ELSE 0 END)  OVER (PARTITION BY cust_no ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS bias_volume
  FROM test_table a
  JOIN test_table2 b ON a.cust_no = b.cust_no
  JOIN test_table3 c ON a.cust_no = c.cust_no
  GROUP BY 1,2,3,4
  </code></pre>