> Right now I have a query which uses decode function to get data in
> Oracle database, I want know is there any alternative function to
> decode which can do the decode functionality in Postgresql.
Oracle: decode (value, 0, 'zero', 1, 'one', 'unknown')
In PostgreSQL you have to use CASE WHEN Syntax:
ANSI: CASE WHEN value=0 THEN 'zero' WHEN value=1 THEN 'one' ELSE
'unknown' END
or
CASE value WHEN 0 THEN 'zero' WHEN 1 THEN 'one' ELSE 'unknown' END
Regards
Doris