p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Oracle (http://p2p.wrox.com/forumdisplay.php?f=105)
-   -   Query with case (http://p2p.wrox.com/showthread.php?t=21008)

marcomfigueroa November 9th, 2004 10:39 AM

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,

      when (count (c.rtado_presentacion))>= 1
      then min (c.cno_oferta)
end) cnoCol1,

      when (count (c.rtado_presentacion))>= 1
      then substr (min (c.cno_oferta),1,1)
end) area1col1,

      when (count (c.rtado_presentacion))>= 1
      then substr (min (c.cno_oferta),2,1)
end) nivel1col1,

      when (count (c.rtado_presentacion))>= 2
      then max (c.cno_oferta)
end) cnocol2,

      when (count (c.rtado_presentacion))>= 2
      then substr (max (c.cno_oferta),1,1)
end) areacol2,

      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

aas November 9th, 2004 11:17 AM

The operator "CASE ... " is not supporting in Oracle 7x.

marcomfigueroa November 9th, 2004 11:29 AM

ok.... ¿ another operator does not exist who can replace the operator CASE in Oracle 7.x ??

stu9820 November 9th, 2004 11:32 AM

I think you can use DECODE for 7.x. I'm not 100% sure.

aas November 9th, 2004 12:00 PM

You can use the DECODE operator in Oracle 7x.

prgcode August 23rd, 2012 12:12 PM

Select -Statement using 2 tables
i have 2 tables apple a and banana b

if a.pineapple= "p" then display "a.first_name" and 'a.last_name"
if a.pineapple = "O" then display "b.code"

can any one hlp me to write the selct statements

ratna2023 January 22nd, 2013 02:51 AM

How Can Learn?
How can learn Oracle, DBA, SQL and total management. Please help

perlongfiona January 22nd, 2013 03:01 AM

use DECODE for 7.x.

All times are GMT -4. The time now is 05:41 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.