title: Mysql SQL syntax group by [asc|desc]?
body: <p>In using mysql8.0 it gives the <a href="https://dev.mysql.com/doc/refman/8.0/en/select.html" rel="nofollow noreferrer"><code>GROUP BY</code></a> syntax as the following:</p>
  <pre><code>[GROUP BY {col_name | expr | position}
    [ASC | DESC], ... [WITH ROLLUP]]
  </code></pre>
  <p>What is the usage of the <code>asc</code> or <code>desc</code> in the group by? Every time I try something like that I get a syntax error and have never seen that syntax before, so was curious what its usage is an what an example of it might be. A query I was using for testing was:</p>
  <pre><code>SELECT 
      provider_id,
      COUNT(*)
  FROM
      titles
  GROUP BY
      provider_id,         -- a col_name
      provider_id='Fox',   -- an expression
      1                    -- a position
      -- where does the ASC|DESC come into play?
      WITH ROLLUP          -- using rollup
  ORDER BY COUNT(*) DESC
  </code></pre>