title: Filtering A MySQL Result Set Based On The Return Value Of A Function
body: <p>I'm a SQL noob, and I need a little bit of help understanding the big picture of if it is possible, and if so how to go about filtering a result set based on the return value of a function which is passed one of the fields of the record.</p>
  
  <p>Let's say I have a table called "Numbers" with just one field: "Value".</p>
  
  <p>How could I correctly specify the following "pseudo-sql"?:</p>
  
  <pre><code>SELECT Value FROM numbers WHERE IsPrime(Value)=true
  </code></pre>
  
  <p>Can I accomplish such a thing, and if so, where/how do I put/store "IsPrime"?</p>
  
  <p>I'm using MySQL.</p>