title: Dividing values in a column by the number of rows returned in the query. Can it be done in a single query?
body: <p>Can I divide the values in a column by the number of rows returned in the query, using a single query?</p>
  
  <p>For example, I select some numeric value from a table based on some condition:</p>
  
  <pre><code>select value from table where ...
  </code></pre>
  
  <p>Let's say it returns N rows and I want the returned values divided by the number of rows returned:</p>
  
  <pre><code>select value / N from table where ...
  </code></pre>
  
  <p>It can be done with several queries (e.g. after the first query, I query the number of rows and do the query again). But can it be done in a single query with some SQL trick without query condition duplication, so that the actual selection (the WHERE part) which may be complicated runs only once?</p>