title: Selecting the percentage of a column
body: <p>What I want to do is select a certain percentage of a column that satisfies a certain condition. I searched for it on this website already and found an answer, but it didn't work when I used it myself. I was wondering what I was doing wrong</p>
  <pre><code>SELECT Total FROM(
   SELECT Collected FROM (
    SELECT COUNT(status) FROM Requests AS Collected
     WHERE status = &quot;A&quot;) / COUNT(status)) 
  FROM Requests
  </code></pre>
  <p>As you can see here I want the percentage that has as status &quot;A&quot;. Could someone tell me what goes wrong here?</p>
  <p>Edit: Thanks for the feedback for asking a question. What I have is the table <code>requests</code>. I want to know the percentage that has status 'A'.</p>
  <p>Request table sample data:</p>
  <pre>
  +--------+--------+
  | Number | Status |
  +--------+--------+
  |      1 | A      |
  |      2 | B      |
  |      3 | B      |
  |      4 | A      |
  |      5 | B      |
  +--------+--------+
  </pre>
  <p>Desired result:</p>
  <pre>
  +-----------------+
  | Percentage_Of_A |
  +-----------------+
  |            40.0 |
  +-----------------+
  </pre>
  <p>Error: `You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '/ COUNT(status)) FROM Requests' at line 4</p>