DECODE

From: David Link <dlink(at)soundscan(dot)com>
To: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: DECODE
Date: 2001-10-30 22:41:47
Message-ID: 3BDF2CAB.A16463F9@soundscan.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi,

How does one do the equivalence of Oracle's DECODE in PostgreSQL?

select
decode (v.media, 'V', 'VHS', 'L', 'Laser Disk', 'Unknown')
from
videos v
;

(ie. if (v.media == 'V') return 'VHS';
elsif (v.media == 'L') return 'Laser Disk';
else return 'Unknown'; )

thanks
dlink

Responses

  • Re: DECODE at 2001-10-31 01:15:26 from Josh Berkus

Browse pgsql-novice by date

  From Date Subject
Next Message Josh Berkus 2001-10-31 01:15:26 Re: DECODE
Previous Message Jason Wong 2001-10-30 16:49:27 Re: Problems connecting from pgAdmin II v1.1 build 59