Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 3B8C0475F8B for ; Fri, 7 Jun 2002 11:27:53 -0400 (EDT) Received: from ece.rice.edu (ece.rice.edu [128.42.4.34]) by postgresql.org (Postfix) with ESMTP id DDF7D475C79 for ; Fri, 7 Jun 2002 10:37:04 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by ece.rice.edu (Postfix) with ESMTP id 0DAD668A5F for ; Fri, 7 Jun 2002 09:37:09 -0500 (CDT) Received: from wallace.ece.rice.edu (wallace.ece.rice.edu [128.42.12.154]) by ece.rice.edu (Postfix) with ESMTP id 5251868A57 for ; Fri, 7 Jun 2002 09:37:08 -0500 (CDT) Received: from reedstrm by wallace.ece.rice.edu with local (Exim 3.34 #1 (Debian)) id 17GKrU-0001tL-00 for ; Fri, 07 Jun 2002 09:37:08 -0500 Date: Fri, 7 Jun 2002 09:37:08 -0500 From: "Ross J. Reedstrom" To: pgsql-admin@postgresql.org Subject: Re: What err ??? Message-ID: <20020607143707.GA7155@rice.edu> Mail-Followup-To: "Ross J. Reedstrom" , pgsql-admin@postgresql.org References: <001701c20e11$b6ff1b00$3a3c620a@catnet.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <001701c20e11$b6ff1b00$3a3c620a@catnet.com.br> User-Agent: Mutt/1.3.27i X-Virus-Scanned: by AMaViS snapshot-20010714 X-Archive-Number: 200206/45 X-Sequence-Number: 4480 On Thu, Jun 06, 2002 at 05:43:28PM -0300, Robson Martins wrote: > What err ??? > > SELECT RazaoSocial + ' - ' + Iif(Bairro Is Null,'',Bairro + ' ') + CGCCli As Coluna FROM Clientes WHERE RazaoSocial Like '%A%' This looks like some other dialect of SQL, not SQL92 (nor PostGreSQL). I _think_ you want something like: SELECT RazaoSocial || ' - ' || COALESCE(Bairro || ' ', '') || CGCCli As Coluna FROM Clientes WHERE RazaoSocial Like '%A%'; The differences are that the text concatenation operator is '||', not '+', and COALESCE(), which returns it's first non-NULL parameter. Note that this is _not_ an ADMIN question: it belongs on NOVICE. Ross -- Ross Reedstrom, Ph.D. reedstrm@rice.edu Executive Director phone: 713-348-6166 Gulf Coast Consortium for Bioinformatics fax: 713-348-6182 Rice University MS-39 Houston, TX 77005