Postgresql行列转换
发布时间:2020-12-13 16:39:27 所属栏目:百科 来源:网络整理
导读:列转行 1 查询测试表数据 [html] view plain copy cqdb = select*fromtest; name ------ AA BB CC (3rows) 2 列转行(string_agg) selectstring_agg(name,',')fromtest; string_agg ------------ AA,BB,CC (1row) 行转列 ----------- A,B,C,D,E (1row) 2 行
列转行1 查询测试表数据
>selectstring_agg(name,',')fromtest; 行转列----------- 2 行转列(regexp_split_to_table) > selectregexp_split_to_table(name,248);">regexp_split_to_table(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |