Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > Oracle
|
Oracle General Oracle database discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 9th, 2004, 10:39 AM
Registered User
 
Join Date: Nov 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to marcomfigueroa Send a message via Yahoo to marcomfigueroa
Default 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


 
Old November 9th, 2004, 11:17 AM
aas aas is offline
Authorized User
 
Join Date: Mar 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to aas
Default

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

 
Old November 9th, 2004, 11:29 AM
Registered User
 
Join Date: Nov 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to marcomfigueroa Send a message via Yahoo to marcomfigueroa
Default

ok.... ¿ another operator does not exist who can replace the operator CASE in Oracle 7.x ??
 
Old November 9th, 2004, 11:32 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

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

 
Old November 9th, 2004, 12:00 PM
aas aas is offline
Authorized User
 
Join Date: Mar 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to aas
Default

You can use the DECODE operator in Oracle 7x.


 
Old August 23rd, 2012, 12:12 PM
Registered User
 
Join Date: Aug 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
 
Old January 22nd, 2013, 02:51 AM
Registered User
 
Join Date: Jan 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Cool How Can Learn?

How can learn Oracle, DBA, SQL and total management. Please help
 
Old January 22nd, 2013, 03:01 AM
Registered User
 
Join Date: Dec 2012
Posts: 4
Thanks: 0
Thanked 1 Time in 1 Post
Default

use DECODE for 7.x.





Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple column update query with Case vinod_yadav1919 SQL Language 4 July 3rd, 2008 06:53 PM
Case help michael.boucher SQL Server 2005 0 May 23rd, 2008 01:45 AM
case clause in query mateenmohd SQL Server 2000 2 February 22nd, 2005 05:49 AM
search string either Upper case or lower case rylemer Beginning VB 6 3 March 24th, 2004 04:23 PM
Check Case in a Case-Insensitive DB nbryson SQL Language 1 January 23rd, 2004 07:36 AM





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