I have a scenario in which I have to get those users whose age is between say (10 - 20) in sql, I have a column with date of birth dob
. By executing the below query I get the age of all users.
SELECT
FLOOR((CAST (GetDate() AS INTEGER) - CAST(dob AS INTEGER)) / 365.25) AS Age
FROM users
My question is how should I write my query so that I can get that users whose age is between 10 to 20