with a as ( select i from unnest (array[2,4,6,7,8,10,13,15,16,18]) s(i))select *from a cross join a b cross join a cwhere a < b and b < corder by a, b, c

with a as ( select i from unnest (array[2,4,6,7,8,10,13,15,16,18]) s(i))select *from a cross join a b cross join a cwhere a < b and b < corder by a, b, c