Si prefiere una solución SQL "limpia" (sin least()
o greatest()
) esto también hace tu trabajo:
select colA, colB from your_table
where colA > colB
or (colB, colA) not in (select colA, colB from your_table)
Si prefiere una solución SQL "limpia" (sin least()
o greatest()
) esto también hace tu trabajo:
select colA, colB from your_table
where colA > colB
or (colB, colA) not in (select colA, colB from your_table)