Ако под „уникални комплекти“ имате предвид това, което мисля, че правите (съжалявам, не знам APL!), можете да напишете:
SELECT e1.number, e2.number, e3.number, e4.number, e.number
FROM elements e1, elements e2, elements e3, elements e4, elements e5
WHERE e1.number < e2.number
AND e2.number < e3.number
AND e3.number < e4.number
AND e4.number < e5.number
;
Да, има трик на Oracle за генериране на данни в движение, използвайки йерархичната заявка и CTE синтаксиса:
WITH elements AS
( select rownum as number
from dual
connect by level <= 56 )
SELECT e1.number, e2.number, e3.number, e4.number, e.number
FROM elements e1, elements e2, elements e3, elements e4, elements e5
WHERE e1.number < e2.number
AND e2.number < e3.number
AND e3.number < e4.number
AND e4.number < e5.number
;