title: SQL syntax error when using count
body: <p>I am trying to calculate the percentage but the count query comes with an error, below is the query</p>
  
  <pre><code>SELECT     COUNT([advice] &lt;&gt;  '0') * 100  / COUNT( DISTINCT userID) As Perc
  FROM         tbUser
  GROUP BY userID
  </code></pre>
  
  <p>Its comes up with the error incorrect syntax near '&lt;' , What i simply want to do is count the advice column with rows having '0' value then divide it by total users to get the percentage.</p>
  
  <p>Any suggestion where i am getting it wrong
  Thanks</p>