title: Alternative syntax i can use to find the percentage and round to 2
body: <p>Please can someone help me with an alternative syntax to the code below, this is yielding an error in MySQL specifically the round statement cos without it and the count, the query runs well... Got the syntax from a lesson I'm following.
  Here is the question: What percentage of days in 2020 were breakout days vs non-breakout days? Round the percentages to 2 decimal places</p>
  <pre><code>SELECT
    ticker,
    ROUND(
      SUM(CASE WHEN price &gt; open THEN 1 ELSE 0 END)
        / COUNT(*)::NUMERIC,
      2
    ) AS breakout_percentage,
    ROUND(
      SUM(CASE WHEN price &lt; open THEN 1 ELSE 0 END)
        / COUNT(*)::NUMERIC,
      2
    ) AS non_breakout_percentage
  FROM trading.prices
  WHERE market_date &gt;= '2020-01-01' AND market_date &lt;= '2020-12-31'
  GROUP BY ticker;
  </code></pre>