On Wednesday 24 September 2008 21:03, Tom Lane wrote:
> Garry Saddington <garry(at)schoolteachers(dot)co(dot)uk> writes:
> > Can anyone tell me why this will not work?
> >
> > select *,
> > CASE WHEN postcode ilike '%OO%' THEN ''
> > END
> > from addresses
> > ...
>
> Define "not work". What are you expecting it to do versus what
> really happens?
>
> Right offhand it looks like the CASE will return either an empty
> string or a NULL, which doesn't seem particularly useful ...
>
> regards, tom lane
It does work but returns a column called case. How can I return the case
column as 'postcode'?
Regards
garry