case expression

From: Garry Saddington <garry(at)schoolteachers(dot)co(dot)uk>
To: Postgres General List <pgsql-general(at)postgresql(dot)org>
Subject: case expression
Date: 2008-09-24 15:33:30
Message-ID: 200809241633.31519.garry@schoolteachers.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Can anyone tell me why this will not work?

select *,
CASE WHEN postcode ilike '%OO%' THEN ''

END
from addresses
where studentid=1234
and addresstype='C'

There are postcodes like this: OO00 0OO

Regards
Garry

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Sullivan 2008-09-24 15:44:42 Re: Obfuscated stored procedures (was Re: Oracle and Postgresql)
Previous Message Bruce Momjian 2008-09-24 15:19:07 Re: Obfuscated stored procedures (was Re: Oracle and Postgresql)