title: "Adding" GROUP BY's and ORDER BY's in one query instead of separate
body: <p>I have a base query that has a few variations, all of them are different from each other in the <code>GROUP BY</code> and <code>ORDER BY</code> clauses.</p>
  <p>These are the variations:</p>
  <pre><code>SELECT SUM(col_a) AS &quot;col_a&quot;, SUM(col_b), AS &quot;col_b&quot;, SUM(col_c) as &quot;col_c&quot;
  FROM my_table
  GROUP BY col_a
  
  SELECT SUM(col_a) AS &quot;col_a&quot;, SUM(col_b), AS &quot;col_b&quot;, SUM(col_c) as &quot;col_c&quot;
  FROM my_table
  GROUP BY col_a, col_b
  ORDER BY col_a
  
  SELECT SUM(col_a) AS &quot;col_a&quot;, SUM(col_b), AS &quot;col_b&quot;, SUM(col_c) as &quot;col_c&quot;
  FROM my_table
  GROUP BY col_a, col_b, col_c
  ORDER BY col_a, col_b
  </code></pre>
  <p>Is it possible to do it in same query? Or I should get the base data and sum it server side/client side?</p>