title: T-SQL: Calculating the Nth Percentile Value from column
body: <p>I have a column of data, some of which are NULL values, from which I wish to extract the single 90th percentile <em>value</em>:</p>
  
  <pre><code>ColA
  -----
  NULL
  100
  200
  300
  NULL
  400
  500
  600
  700
  800
  900
  1000
  </code></pre>
  
  <p>For the above, I am looking for a technique which returns the value 900 when searching for the 90th percentile, 800 for the 80th percentile, etc.  An analogous function would be AVG(ColA) which returns 550 for the above data, or MIN(ColA) which returns 100, etc.</p>
  
  <p>Any suggestions?</p>