This query method works :
SELECT xxx
FROM xxx-table
WHERE YEAR( CURRENT_DATE( ) ) - YEAR( '1988-10-27' )
- ( DATE_FORMAT( CURRENT_DATE( ) , '%m-%y' ) < '12-31' )
Between 20 and 25
But what I need is something like this...
SELECT YEAR( CURRENT_DATE( ) )
- YEAR( '(Select xxx
From xxx-table
where year_id=9 limit 1)-10-27' )
- ( DATE_FORMAT( CURRENT_DATE( ) , '%m-%y' )
< '12-31' )
Between 20 and 25
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?
Thanks in advance!