title: MySQL error: What is wrong with my syntax for ranking?
body: <p>My MySQL version is 5.6.<br>
  I have a MySQL query that I getting error and need help to understand what I am doin wrong.</p>
  
  <p>Here is the query:</p>
  
  <pre><code>select images.thumbnail16x9_file,
         images.square_file,
         RANK() OVER (ORDER BY images.timestamp desc) rank
  from images 
  where images.media_id = 875021;
  </code></pre>
  
  <p>This is the error message:</p>
  
  <blockquote>
    <p>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 '(ORDER BY images.timestamp ) rank<br>
    from images where images.media' at line 3</p>
  </blockquote>
  
  <p>I get result back if I do:</p>
  
  <pre><code>select images.thumbnail16x9_file,
         images.square_file
  from images 
  where images.media_id = 875021 ;
  </code></pre>
  
  <p>Any insight?</p>