Forum Discussion
Zdenek_Moravec
Jan 21, 2024Brass Contributor
How to wrap table, not vector (WRAPCOLS for tables)
Dear colleagues I have a long table of 5 columns and maybe 200 rows. The task is to wrap the table after a specified number of rows to see the table in landscape on a new sheet. I was thinking abo...
peiyezhu
Jan 25, 2024Bronze Contributor
 SQL:
create temp table aa as
select (row_number() over ( partition by f01)-1)%4 r ,* from wrap_table;
//select * from aa;
create temp table bb as
select r,f01,group_concat(f02||'</td><td>'||f03||'</td><td>'||f04||'</td><td>'||f05||'</td><td>'||f06,'</td><td>') cols from aa group by r,f01;
select udf_exec_sql('select cols '||f01||' from bb where f01 like '''||f01||'''') 'Data' from wrap_table group by f01;