Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Need Help with SQL - Repost
Check out the decode function in the Oracle Sql reference manual. Oracle 8.1.6 and higher support a true case statement.
Finally, I'm not sure why you post this question 2 times within 9 minutes. IMO, this is very rude, as usenet is a volunteer business, and you are not the only one with questions.
Hth,
Sybrand Bakker, Oracle DBA
"Anna Henson" <anna_henson_at_yahoo.com> wrote in message
news:t5sc80i5ljdleb_at_corp.supernews.com...
> Hello Oracle Users,
>
> I would like to write a query similar to the one below, but Oracle does
not
> accept 'IF' statement. Is there anyother way to
> write a query similar to the one below.
>
> select a.score , (If b.score in (11,12,13) then InActive=1),
> (If b.score NOT in (11,12,13) then Active=1), sum(b.Balance)
>
> from OldTable a, NewTable b
> group by a.score;
>
>
> Thanks,
>
> Anna Henson
>
>
Received on Thu Jan 11 2001 - 16:53:22 CST
![]() |
![]() |