Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f28KE2x27030 for ; Thu, 8 Mar 2001 15:14:02 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.1/8.11.1) with ESMTP id f28KDs929759; Thu, 8 Mar 2001 15:13:54 -0500 (EST) To: Matthew cc: pgsql-general@postgresql.org Subject: Re: SQL Question In-reply-to: <183FA749499ED311B6550000F87E206C1FD049@srv.ctlno.com> References: <183FA749499ED311B6550000F87E206C1FD049@srv.ctlno.com> Comments: In-reply-to Matthew message dated "Thu, 08 Mar 2001 12:36:22 -0600" Date: Thu, 08 Mar 2001 15:13:54 -0500 Message-ID: <29756.984082434@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200103/388 X-Sequence-Number: 5874 Matthew writes: > What I would like is something like this (using pseudo sql) > select (if(col1>1) true else if (col1<= 1) false) from foo; This particular example could be written as just select col1>1 from foo since a boolean result is a perfectly good result. More generally, you could use the CASE construct for conditional expressions. See http://www.postgresql.org/devel-corner/docs/postgres/functions-conditional.html regards, tom lane