title: MySQL Calculating a percentage from two counts in the same table
body: <p>I'm trying to calculate a percentage of customers that live within a specified range (&lt;=10miles) from the total number of customers, the data comes from the same table.</p>
  
  <p>Customer_Loc (table name)</p>
  
  <p>Cust_ID | Rd_dist (column names)</p>
  
  <p>I've tried the query below which returns syntax errors. </p>
  
  <pre><code>select count(Rd_dist) / count (Cust_ID)
  from customer_loc
  where Rd_Dist &lt;=10 *100 as percentage 
  </code></pre>
  
  <p>I realise the solution to this may be fairly easy but I'm new to SQL and it's had me stuck for ages.</p>