81,092
社区成员
发帖
与我相关
我的任务
分享
with tab1 as (
select 'kaohe' col1, 1 ord, 'a-----' detail, 1 detail_type from dual union all
select 'kaohe' col1, 2 ord, 'a-----', 1 from dual union all
select 'kaohe' col1, 3 ord, 'a-----', 2 from dual union all
select 'dingxingkaohe' col1, 4 ord, 'a-----', 2 from dual union all
select 'dingxingkaohe' col1, 5 ord, 'a-----', 2 from dual
)
select t1.col1,
row_number() over(partition by t1.col1 order by ord) rn,
count(1) over(partition by t1.col1 order by ord) cn,
t1.detail,
t1.detail_type
from tab1 t1
order by t1.ord
;
前端通过rn==1来判断是否输出td,并且以cn为rowspan去合并单元格。第四列只有两种格式,普通的td与带有去边框、滚动条的textarea的td,具体是哪个通过detail_type判断。