pgsql将逗号隔开的数据拆分成多列

pgsql将逗号隔开的数据拆分成多列_第1张图片

select dept_id,regexp_split_to_table(pharmacy_dept_id,‘,’)

AS NAME from comm.config_out_dept;

select dept_id,unnest(string_to_array(pharmacy_dept_id,‘,’))

AS NAME from comm.config_out_dept;

pgsql将逗号隔开的数据拆分成多列_第2张图片

你可能感兴趣的:(sql,mysql,数据库,postgresql)