title: How to apply a function to an entire column?
body: <p>I have the following table from a JDBC connection in Q.</p>
  
  <pre><code>q)r
  some_int this              created_at                    updated_at          ..
      -----------------------------------------------------------------------------..
  1231231    "ASD" 2016.02.11D14:16:29.743260000 2016.02.11D14:16:29...
  13312    "TSM" 2016.02.11D14:16:29.743260000 2016.02.11D14:16:29...
  </code></pre>
  
  <p>I would like to apply the following function to the first column.</p>
  
  <pre><code>deviation:{a:avg x; sqrt avg (x*x)-a*a}
  </code></pre>
  
  <p>This works for arrays.</p>
  
  <pre><code>q)l
  1 2 3 4
  q)deviation l
  1.118034
  </code></pre>
  
  <p>How can I apply deviation on a column in a table? It seems my approach does not work:</p>
  
  <pre><code>q)select deviation(some_id) from r
  'rank
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p>I cannot explain the following:</p>
  
  <pre><code>q)select avg(some_int) from r
  some_int
  ---------
  1005341
  q)select min(some_int) from r
  some_int
  ---------
  812361
  q)select max(some_int) from r
  some_int
  ---------
  1184014
  q)select sum(some_int) from r
  some_int
  ---------
  </code></pre>