我需要用 0 和 1 组合制作一个矩阵:
SELECT 1 AS F1, 0 AS F2 ,0 AS F3,0 AS F4, 0 AS F5 FROM DUAL
UNION ALL
SELECT 0 AS F1, 1 AS F2 ,0 AS F3,0 AS F4, 0 AS F5 FROM DUAL
UNION ALL
SELECT 0 AS F1, 0 AS F2 ,1 AS F3,0 AS F4, 0 AS F5 FROM DUAL
UNION ALL
SELECT 0 AS F1, 0 AS F2 ,0 AS F3,1 AS F4, 0 AS F5 FROM DUAL
UNION ALL
SELECT 0 AS F1, 0 AS F2 ,0 AS F3,0 AS F4, 1 AS F5 FROM DUAL
您是否有一些更棘手或更优雅的代码来实现这一目标?
我在 Oracle 19c
谢谢