- aligning
select c1 c from tabela
union all
select c2 c from tabela
union all
select c3 c from tabela
union all
select c4 c from tabela
union all
select c5 c from tabela
- reading as a table
select virtual1.*
from
(
select c1 c from tabela
union all
select c2 c from tabela
union all
select c3 c from tabela
union all
select c4 c from tabela
union all
select c5 c from tabela
) virtual1
- Forcing a Cartesian
select virtual1.*,virtual2.*
from
(
select c1 c from tabela
union all
select c2 c from tabela
union all
select c3 c from tabela
union all
select c4 c from tabela
union all
select c5 c from tabela
) virtual1,
(
select c1 c from tabela
union all
select c2 c from tabela
union all
select c3 c from tabela
union all
select c4 c from tabela
union all
select c5 c from tabela
) virtual2
where virtual1.c <. virtual2.c
The basic idea is to unpivot the table and then force a Cartesian.