Query with case
hello, i have this query, it works in Oracle 9 and 8 but not works in oracle 7, appears an Oracle: ORA-00907: missing right parenthesis error in the line where the CASE begins....
some help???
select o.identificacion,
count (*) envios,
count (c.rtado_presentacion) colocaciones,
(case
when (count (c.rtado_presentacion))>= 1
then min (c.cno_oferta)
end) cnoCol1,
(case
when (count (c.rtado_presentacion))>= 1
then substr (min (c.cno_oferta),1,1)
end) area1col1,
(case
when (count (c.rtado_presentacion))>= 1
then substr (min (c.cno_oferta),2,1)
end) nivel1col1,
(case
when (count (c.rtado_presentacion))>= 2
then max (c.cno_oferta)
end) cnocol2,
(case
when (count (c.rtado_presentacion))>= 2
then substr (max (c.cno_oferta),1,1)
end) areacol2,
(case
when (count (c.rtado_presentacion))>= 2
then substr (max (c.cno_oferta),2,1)
end) nivelcol2
from cruce c, ofertas o
where o.fecha_inscripcion >= '01/01/2004'
and o.fecha_inscripcion <= '09/30/2004'
and c.identificacion_oferta = +o.identificacion
group by o.identificacion
order by colocaciones
|