select * from table1 where biryear between year(curdate())-30 and year(curdate())-20
mysql> select *,year(curdate())-biryear as age from t where year(curdate())-biry ear between 20 and 30 // +------+---------+------+ | id | biryear | age | +------+---------+------+ | 2 | 1981 | 30 | | 3 | 1982 | 29 | +------+---------+------+
selecte * from table where year between 20 and 30
select * from table1 where biryear between year(curdate())-30 and year(curdate())-20
mysql> select *,year(curdate())-biryear as age from t where year(curdate())-biry
ear between 20 and 30 //
+------+---------+------+
| id | biryear | age |
+------+---------+------+
| 2 | 1981 | 30 |
| 3 | 1982 | 29 |
+------+---------+------+
where biryear between year(curdate())-30 and year(curdate())-20