在下面的查询中,该参数date_part('year', CURRENT_DATE) - f.birth_year
重复了 3 次。我怎样才能用它的别名替换它age
?
SELECT
date_part('year', CURRENT_DATE) - f.birth_year AS age
FROM
public.foo f
WHERE
date_part('year', CURRENT_DATE) - f.birth_year >=20 AND
date_part('year', CURRENT_DATE) - f.birth_year <=30