方法一【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 结果:
1单表查询结果出来只有一行结果
select * from table;2现在将查询结果由列转为行展示
select unnest(string_to_array(concat_ws(,,a.t_dev_names,a.t_dev_ids,a.T_PORT_NAMES,a.T_PORT_IDS),,)) as result from table as a步骤分析:
concat_ws:将几个字段合并为一个字段并用…