title: Noob need help in age calculation
body: <p>This query method works : </p>
  
  <pre><code>SELECT xxx 
  FROM xxx-table 
  WHERE YEAR( CURRENT_DATE( ) ) - YEAR( '1988-10-27' ) 
                          - ( DATE_FORMAT( CURRENT_DATE( ) , '%m-%y' ) &lt; '12-31' ) 
                                    Between 20 and 25 
  </code></pre>
  
  <p>But what I need is something like this...</p>
  
  <pre><code>SELECT YEAR( CURRENT_DATE( ) )
                       - YEAR( '(Select xxx 
                                  From xxx-table 
                                  where year_id=9 limit 1)-10-27' ) 
                                   - ( DATE_FORMAT( CURRENT_DATE( ) , '%m-%y' )
                             &lt; '12-31' ) 
          Between 20 and 25 
  </code></pre>
  
  <p>I need to extract value from the database and process it using a sub queries but it doesn't work.  I guess sub queries aren't allow in function.  Is there a work around on this?</p>
  
  <p>Thanks in advance!</p>