--创建测试表,插入测试数据
create table test_split(id int,name varchar);
insert into test_split select 1,'a;b;c;d';
insert into test_split select 2,'e;f;h;g';
select * from test_split;
id |name
----+---------
1 | a;b;c;d
2 | e;f;h;g
--查询
select id,unnest(string_to_array(name,';')) as name from test_split;
--结果
id | name
----+------
1 | a
1 | b
1 | c
1 | d
2 | e
2 | f
2 | h
2 | g
(8 rows)