--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 make an "unpivot" of the table and then force a Cartesian.
Wow, I’ll try, and I’ll send a reply
– Hermeson
v1 and v2 would be the correct values? then I would put 1., 2.? because it is giving syntax error from the first select select v1., v2.
– Hermeson
It is the "alias" of the virtual table, I mounted with a name and called by another , corrected ...
– Motta
Unfortunately it didn’t work. I did it in Delhi, but it takes about 30 minutes to complete the readings.. because it combines the values X and Y in all fields and all lines and still makes the sum of the same.
– Hermeson
What went wrong ?
– Motta