带有分隔符的字符串列的排序方式如何工作?

时间:2019-07-02 11:30:42

标签: sql oracle

任何想法如何对具有带分隔符的字符串的列进行按序排序

with temp as 
(
  select 108 Name, 'test' Project, 'Err1, Err2, Err3' Error  from dual
  union all
  select 109, 'test2', 'Err1' from dual
)
 select distinct Name, Project, trim(regexp_substr(str, '[^,]+', 1, level)) str
   from ( select Name, Project, Error str from temp) t
connect by instr(str, ',', 1, level - 1) > 0
  order by Name        

0 个答案:

没有答案