Query to return modified results at runtime? - Mailing list pgsql-sql

From George Handin
Subject Query to return modified results at runtime?
Date
Msg-id 44876F63.9030302@dafunks.com
Whole thread Raw
Responses Re: Query to return modified results at runtime?
Re: Query to return modified results at runtime?
List pgsql-sql
I have a query:

SELECT * FROM testtable;

Where the results are:

ID    Color
---   -------
1     Blue
2     Red
3     Green
4     Orange

How would I rewrite the query to return results where the colors are 
replaced by letters to give the following results?

ID    Color
---   -------
1     A
2     D
3     B
4     C


pgsql-sql by date:

Previous
From: Richard Broersma Jr
Date:
Subject: Re: How To Exclude True Values
Next
From: Richard Broersma Jr
Date:
Subject: Re: Query to return modified results at runtime?