title: What is the problem in IF statement in this code?
body: <pre><code>select studentid,
  sum(score) 'Total',
  avg(IF(score&gt;85)) 'Average',
  max(score) 'Maximum',
  min(score) 'Minimum'
  from results
  group by studentid;
  </code></pre>
  <p><strong>Error Message:</strong></p>
  <blockquote>
  <p>You have an error in your SQL syntax; check the manual that
  corresponds to your MariaDB server version for the right syntax to use
  near ')) 'Average',</p>
  <p>max(score) 'Maximum',</p>
  </blockquote>