Multiple values in a field in Oracle separated by commas (,) have encountered abnormal problems recently. A field has a field association relationship with another table, the Unit Field stores multiple IDs separated by commas (,). There are quite a few people who have found this problem online, I sorted out some questions for a netizen and turned to www.2cto.com Table a: a_usr_id (string type, usr_id of associated table B) 123,124,125 Table B: usr_id, usr_name, 123 name1 124 name2 125 name3 use SQL statements directly without using stored procedures to obtain such a data set: www.2cto.com name1, name2, name3 solution: SQL> select * from test; a_URS_ID limit 123,125 123,124,125 SQL> select * from test1; URS_ID URS_NAME ---------- -------------------- 123 name1 124 name2 125 name3 SQL> with split_data as (select key, rn, substr (str, instr (str, ',', 1, rn) + 1, instr (str, ',', 1, rn + 1)-instr (str, ',', 1, rn) -1) str from (select a_urs_id key, ',' | a_urs_id | ', 'str from test) a, (select rownum rn from dual connect by rownum <10) B where instr (str, ',', 1, rn + 1)> 0) select key, substr (max (sys_connect_by_path (urs_name, ','), 2) a_name from split_data a, test1 B where. str = B. urs_id start with rn = 1 connect by key = prior key and rn-1 = prior rn group by key; KEY A_NAME ------------------ limit 123,124,125 name1, name2, name3 123,125 name1, name3