select files col1,null col2 from tbldemo where length(files)<=15 union select substr(files,1,15),substr(files,16) from tbldemo where length(files)>15
select files col1,null col2 from tbldemo where length(files)<=&&i union select substr(files,1,&&i),substr(files,&&i+1) from tbldemo where length(files)>&&i;
select a.files col1,b.files col2 from (select rownum no,files from tbldemo where rownum<16) a,(select rownum no,files from tbldemo where rownum<31) b where a.no+15=b.no(+);以上为假设表有<=30行。不过我觉得这样的SQL没什么意义,还是建议楼主在前台处理,我感觉这样的操作仅仅是为了显示数据(如报表)
union
select substr(files,1,15),substr(files,16) from tbldemo where length(files)>15
union
select substr(files,1,&&i),substr(files,&&i+1) from tbldemo where length(files)>&&i;
where a.no+15=b.no(+);以上为假设表有<=30行。不过我觉得这样的SQL没什么意义,还是建议楼主在前台处理,我感觉这样的操作仅仅是为了显示数据(如报表)
可能我表达不是很清楚!不好意思!
union all
(
select null,files from tbldemo
minus
select null,files from tbldemo where rownum<=100
)