Re: Something like DECODE( ) in Oracle...
Posted in 2000
You have DECODE function in Informix 7.31. There are lot of new
features in SQL like CASE etc available in this version.
Vivek Chaudhary
On Mon, 17 Apr 2000 15:15:52 +0900, "nextream" <nextream@hotmail.com>
wrote:
>Hi.
>Is there any function similar to decode() in Oracle?
>
>I am trying to get query result as follows:
> acct D C
> A01 100 0
> A02 0 200
>
>from the table as follows:
> acct crdr amount
> A01 D 100
> A02 C 200
>
>My first thought is:
> select acct, amount, 0 from table1 where crdr="D"
> union
> select acct, 0, amount from table1 where crdr="C">too tricky or heavy load?
>
>In Oracle, this will be done with only 2 decode() I think...
>but I have to make it go with Informix, and,
>I'm trying not to make user defined stored procedure (if possible).
>
>Thanks for any comments~
>
>