Query to return modified results at runtime?

From: George Handin <postgresql(at)dafunks(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Query to return modified results at runtime?
Date: 2006-06-08 00:29:23
Message-ID: 44876F63.9030302@dafunks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Broersma Jr 2006-06-08 01:03:21 Re: How To Exclude True Values
Previous Message operationsengineer1 2006-06-07 23:29:28 Re: How To Exclude True Values