col a for 99
col b for 99
col c for 99
col d for 99
col e for 99
col f for 99
col g for 99
col h for 99
select a,b,c,d,e,f,g,h
from (select RowNum as a from dict where RowNum <=8),
(select RowNum as b from dict where RowNum <=8),
(select RowNum as c from dict where RowNum <=8),
(select RowNum as d from dict where RowNum <=8),
(select RowNum as e from dict where RowNum <=8),
(select RowNum as f from dict where RowNum <=8),
(select RowNum as g from dict where RowNum <=8),
(select RowNum as h from dict where RowNum <=8)
where a not in(b,c,d,e,f,g,h)
and b not in( c,d,e,f,g,h)
and c not in( d,e,f,g,h)
and d not in( e,f,g,h)
and e not in( f,g,h)
and f not in( g,h)
and g not in( h)
and abs(a-b) != 1 and abs(a-c) != 2 and abs(a-d) != 3 and abs(a-e) != 4 and abs(a-f) != 5
and abs(a-g) != 6 and abs(a-h) != 7 and abs(b-c) != 1 and abs(b-d) != 2 and abs(b-e) != 3
and abs(b-f) != 4 and abs(b-g) != 5 and abs(b-h) != 6 and abs(c-d) != 1 and abs(c-e) != 2
and abs(c-f) != 3 and abs(c-g) != 4 and abs(c-h) != 5 and abs(d-e) != 1 and abs(d-f) != 2
and abs(d-g) != 3 and abs(d-h) != 4 and abs(e-f) != 1 and abs(e-g) != 2 and abs(e-h) != 3
and abs(f-g) != 1 and abs(f-h) != 2 and abs(g-h) != 1
and a < h -- 線対称のパターンを排除
order by a,b,c,d,e,f,g,h;