方法一【date_part()
】
select date_part('year',age('1997-10-01'::timestamp)) as age
结果:
方法二【extract()
】
select extract('year' from age('1997-10-01'::timestamp)) as age
结果:
方法一【date_part()
】
select date_part('year',age('1997-10-01'::timestamp)) as age
结果:
方法二【extract()
】
select extract('year' from age('1997-10-01'::timestamp)) as age
结果: