Skip site navigation (1) Skip section navigation (2)

Re: case expression

From: Guy Rouillier <guyr-ml1(at)burntmail(dot)com>
To: Postgres General List <pgsql-general(at)postgresql(dot)org>
Subject: Re: case expression
Date: 2008-09-25 01:49:57
Message-ID: 48DAEE45.5050908@burntmail.com (view raw or flat)
Thread:
Lists: pgsql-general
Garry Saddington wrote:

> It does work but returns a column called case. How can I return the case 
> column as 'postcode'?

select
CASE WHEN postcode ilike '%OO%' THEN ''
END as postcode
from addresses

-- 
Guy Rouillier

In response to

pgsql-general by date

Next:From: hubert depesz lubaczewskiDate: 2008-09-25 05:35:39
Subject: Re: problem with custom_variable_classes
Previous:From: Fernando MorenoDate: 2008-09-25 01:18:52
Subject: Re: case expression

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group