Hi everyone, I've been looking for answers on the internet for developing this query with criteria but i couldn't find anything.
This is my table and query:
Code:
create table numeros (numero_desde integer, numero_hasta integer);
insert into numeros values (3,5);
insert into numeros values (8,13);
insert into numeros values (19,20);
insert into numeros values (20,21);
insert into numeros values (31,31);
select datos.minimo, datos.anterior, decode(datos.anterior,null,datos.minimo,datos.anterior)
from (
select * from
(select min(numero_desde) minimo from numeros where numero_desde > 8) a,
(select max(numero_desde) anterior from numeros where numero_desde <= 8) b ) datos
I could develop both simple selects of min and max with criteria. But, as you can see, I need them as a simple recordset/resultset (call it as you wish :P) to be used as a From to then apply a decode.
Can anyone help me?
Thanks!
Beto