title: SQL UPDATE in a SELECT rank over Partition sentence
body: <p>There is my problem, I have a table like this:</p>
  
  <pre><code>Company, direction, type, year, month, value, rank
  </code></pre>
  
  <p>When I create the table, rank is 0 by default, and what I want is to update rank in the table using this select:</p>
  
  <pre><code>SELECT company, direction, type, year, month, value, rank() OVER (PARTITION BY direction, type, year, month ORDER BY value DESC) as rank
  FROM table1
  GROUP BY company, direction, type, year, month, value
  ORDER BY company, direction, type, year, month, value;
  </code></pre>
  
  <p>This Select is working fine, but I can't find the way to use it to update table1</p>
  
  <p>I have not find any answer solving a problem like this with this kind of sentence. If someone could give me any advice about if it is posible to do or not I would be very grateful.</p>
  
  <p>Thanks! </p>