title: SELECT command to calculate percentage
body: <p>I'm trying to get the percentage of each video I have in my database based on its view count against all other videos.</p>
  
  <p>I'm then trying to display all the videos from highest view count to lowest, displaying its percentage on its side inside a nice HTML page. </p>
  
  <p>Obviously the percentage would range from 0 - 100% (and not over) and the most popular video would probably have 100% I assume.. </p>
  
  <p>I have about 3,400 videos in the database. My attempts are laughable and have been scratching my head for about days now..</p>
  
  <p>My table looks something similar to this.</p>
  
  <pre><code>video_public
  id | video_title | video_views
  </code></pre>
  
  <p>Attempt:</p>
  
  <pre><code>SELECT 
     id, 
     video_views * 100 / (SELECT COUNT(*) FROM video_public)
  FROM `video_public` stat
  </code></pre>
  
  <p>To be honest I don't even know if this SQL query is right.</p>
  
  <p>I haven't even taken into consideration the <strong>videos views</strong> against <strong>all video views</strong> and <strong>total videos</strong>..</p>
  
  <p><em>Really stuck..</em></p>