X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id D8AF011F6C98 for ; Wed, 5 Apr 2006 13:59:54 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 78922-09 for ; Wed, 5 Apr 2006 13:59:46 -0300 (ADT) X-Greylist: delayed 00:15:26.517709 by SQLgrey- Received: from vertical.domsis.com.br (vertical.domsis.com.br [201.24.75.90]) by postgresql.org (Postfix) with ESMTP id C4B4B11F6C27 for ; Wed, 5 Apr 2006 13:59:43 -0300 (ADT) Received: by VERTICAL with Internet Mail Service (5.5.2657.72) id ; Wed, 5 Apr 2006 13:45:27 -0300 Message-ID: From: Renato Cramer To: "Pgsql-Sql (E-mail)" Subject: IF statement in Select Date: Wed, 5 Apr 2006 13:45:25 -0300 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: text/plain; charset="iso-8859-1" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.593 required=5 tests=[AWL=0.593] X-Spam-Score: 0.593 X-Spam-Level: X-Archive-Number: 200604/20 X-Sequence-Number: 24829 Hello all, Is the use of IF statement restrict to Functions and Store Procedures? I'm trying to use an IF within Select... Example: create view v1 as select c1, c2, if c3 = 52 then 0 else 1 endif as base_irrf_13 from t1; Thanks in advance, Renato Cramer.