Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Rudy Fernandes — — source: Informix-list mailing list archive (1991-1998)
If you are using v7.3 or greater, try the following :
select acct,
case when crdr = 'D' then amount
else 0
end,
case when crdr = 'C' then amount
else 0
end
from <table>
where ...
HTH
Rudy
nextream 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
>
> ...Thanks for any comments~
Your privacy choices
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.