X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 386A652806 for ; Mon, 27 Jun 2005 14:45:30 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 62220-06 for ; Mon, 27 Jun 2005 17:45:21 +0000 (GMT) Received: from mail.valleypres.org (mail.valleypres.org [63.196.151.90]) by svr1.postgresql.org (Postfix) with ESMTP id 163DE52913 for ; Mon, 27 Jun 2005 14:45:20 -0300 (ADT) Received: from valleypres.org (mail.valleypres.org [172.16.12.253]) by mail.valleypres.org (Postfix) with ESMTP id 3F0199365B; Mon, 27 Jun 2005 10:45:20 -0700 (PDT) Received: from [172.16.55.141] (helo=AT10111) by valleypres.org with smtp (Exim 3.13 #3) id 1Dmxfc-0005th-00; Mon, 27 Jun 2005 10:45:20 -0700 Reply-To: From: "Bryan Encina" To: "'Roy Souther'" , Subject: Re: How can I simply substatue a value in a query? Date: Mon, 27 Jun 2005 10:45:36 -0700 Message-ID: <00ab01c57b40$07425c00$8d3710ac@AT10111> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 In-Reply-To: <1119892618.7882.4.camel@UtopiaPlanetia> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.28 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/317 X-Sequence-Number: 21918 -----Original Message----- From: pgsql-sql-owner@postgresql.org = [mailto:pgsql-sql-owner@postgresql.org]On Behalf Of Roy Souther Sent: Monday, June 27, 2005 10:17 AM To: pgsql-sql@postgresql.org 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