RosettaCodeData/Task/List-comprehensions/DuckDB/list-comprehensions-4.duckdb
2025-08-11 18:05:26 -07:00

5 lines
170 B
Text

create or replace function list_triples(n) as (
list_filter(
(select array_agg([x,y,z] order by x) from xyz(n)),
x -> x[1]*x[1] + x[2]*x[2] = x[3]*x[3] )
);