select it again
a wrong example:
select *, (YEAR(CURDATE())-YEAR(dob)) - (RIGHT(CURDATE(),5)
the correct one (assign a new name to the new selected table by using table alias):
select * from
(select *, (YEAR(CURDATE())-YEAR(dob)) - (RIGHT(CURDATE(),5)
As age from `main_tb`)
as new_tb_name
where age >= 21 and age <= 36;
No comments:
Post a Comment