| From: | "Jim Buttafuoco" <jim(at)contactbda(dot)com> | 
|---|---|
| To: | Roy Souther <roy(at)SiliconTao(dot)com>, pgsql-sql(at)postgresql(dot)org | 
| Subject: | Re: How can I simply substatue a value in a query? | 
| Date: | 2005-06-27 17:35:07 | 
| Message-ID: | 20050627173415.M31195@contactbda.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-sql | 
try case
for example
select case when bool_column then 'Yes' else 'No end from your_table;
---------- Original Message -----------
From: Roy Souther <roy(at)SiliconTao(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Sent: Mon, 27 Jun 2005 11:16:58 -0600
Subject: [SQL] How can I simply substatue a value in a query?
> I want to do a simple substatution of a value in a query. For example I
> have a boolean field that wil return t or f for True and False. I would
> like it to return Yes or No. I don't want to have a 2x2 table to look up
> the output. I don't want to use stored procedue.
> 
> I think there is a better way, somthing very simple but I cannot
> remember what it is.
> 
> Roy Souther
> www.SiliconTao.com
> Let Open Source help your business move beyond.
> 
> For security this message is digitally authenticated by GnuPG.
------- End of Original Message -------
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Bryan Encina | 2005-06-27 17:45:36 | Re: How can I simply substatue a value in a query? | 
| Previous Message | Sean Davis | 2005-06-27 17:31:37 | Re: How can I simply substatue a value in a query? |