在搜索论坛后,我想出了以下内容,但它不起作用:/将字符串拆分成行Oracle SQL
我有一个表格,
ID | Strings
123| abc fgh dwd
243| dfs dfd dfg
353| dfs
424| dfd dfw
523|
.
.
.
请不有大约20,000行我的另一种选择是写一个存储过程做到这一点...基本上,我需要拆分串起来所以为每一个这样的
行ID | Strings
123| abc
123| fgh
123| dwd
243| dfs
等等...
这就是我。
create table Temp AS
SELECT ID, strings
From mytable;
SELECT DISTINCT ID, trim(regexp_substr(str, '[^ ]+', 1, level)) str
FROM (SELECT ID, strings str FROM temp) t
CONNECT BY instr(str, ' ', 1, level -1) >0
ORDER BY ID;
任何帮助表示赞赏
我能想到这样做将是非常低效的唯一途径。在接收到数据库的初始响应后,您是否有理由在编程语言中无法做到这一点? – Sam 2014-10-16 15:57:13