Re: [SQL] Help on update that subselects other records in table, uses joins

2003-10-29 Thread Bryan Encina
>I suggest Joe Conway's "SQL for Smarties"  or "SQL Queries for Mere
Mortals"
>from another author.

I could be mistaken, but I'm pretty sure Josh means Joe Celko's "SQL for
Smarties" as I've seen him mention it before, and not Joe Conway.

-b



---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org


Re: [SQL] How can I simply substatue a value in a query?

2005-06-27 Thread Bryan Encina
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Roy Souther
Sent: Monday, June 27, 2005 10:17 AM
To: [email protected]
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.

-

I think a CASE statement is what you want.  Check the Conditional Expressions 
section of the docs at:
http://www.postgresql.org/docs/8.0/interactive/functions-conditional.html
HTH,
Bryan Encina


---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster