RosettaCodeData/Task/Matrix-transposition/DuckDB/matrix-transposition-3.duckdb
2025-08-11 18:05:26 -07:00

5 lines
308 B
Text

# Note that if the input is not rectangular, the output might be lossy.
create or replace function transpose(lst) as (
select list_transform( range(1, 1+length(lst[1])),
j -> list_transform(range(1, length(lst)+1),
i -> lst[i][j]) ));