Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Case when with 2 conditions

Re: Case when with 2 conditions

From: Robert Klemme <bob.news_at_gmx.net>
Date: Fri, 02 Jun 2006 16:51:13 +0200
Message-ID: <4eb1j1F1d7es9U1@individual.net>


Mark C. Stock wrote:
> "Robert Klemme" <bob.news_at_gmx.net> wrote in message
> news:4eb0aqF1dh124U2_at_individual.net...
> : Mark C. Stock wrote:
> : > "Carlos Antonio" <carlosantoniovazquez_at_gmail.com> wrote in message
> : > news:1149256039.122215.145200_at_h76g2000cwa.googlegroups.com...
> : > : Hello,
> : > :
> : > : How can I use the case when statement, but with 2 conditions?
> : > :
> : > : is it like ...
> : > :
> : > : case
> : > : when (field1 = 'A' and Field2 = 'B') then 'C'
> : > : else 'Z'
> : > : end as whatever_result
> : > :
> : > :
> : > : ...???
> : > :
> : > :
> : > : Any help will be appreciated
> : > :
> : >
> : > try it...
> :
> : Carlos, note also the usage of "=" vs. "=="...
> :
> : robert
>
> not sure exactly what your suggesting to note, but there is no '==' in
> PL/SQL or SQL
>
> in SQL and PL/SQL '=' is the comparison operator
>
> in PL/SQL ':=' is the assignment operator
>
> in the SQL UPDATE command SET clause, '=' doubles the assignment operator

Ooops, I mixed up newsgroups. Sorry for the noise.

As a sidenote, the code above is perfectly legal Ruby code - even with the "assignment", that's why. :-)

Kind regards

        robert Received on Fri Jun 02 2006 - 09:51:13 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US