title: KDB using function in where clause
body: <p>Is there a way in kdb to use functions in queries. assume I have a table with columns</p>
  
  <pre><code>`red`blue`green`yellow`white`purple
  </code></pre>
  
  <p>which contain either values 0 or 1. Instead of querying </p>
  
  <pre><code>select where ((red=1) or (green=1))
  </code></pre>
  
  <p>can I use a function like</p>
  
  <pre><code>isRG:{((select green from x)=1) or ((select red from x)=1)}
  </code></pre>
  
  <p>to filter a select?
  I can do</p>
  
  <pre><code>f:[select from t] 
  </code></pre>
  
  <p>and it returns a column with true and false, but I cant figure out how to do something along the lines of</p>
  
  <pre><code>select from t where f[select from t]
  </code></pre>
  
  <p>to get all entries where f(x) is true</p>