X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 11A819FB258 for ; Tue, 12 Sep 2006 16:41:33 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 27466-01-2 for ; Tue, 12 Sep 2006 16:39:18 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from web53510.mail.yahoo.com (web53510.mail.yahoo.com [206.190.37.71]) by postgresql.org (Postfix) with SMTP id 28BC89FB29A for ; Tue, 12 Sep 2006 16:26:28 -0300 (ADT) Received: (qmail 63528 invoked by uid 60001); 12 Sep 2006 19:26:28 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=PPGOotosnkKE9oFm8GWCvvsaDOBNEoSYLascxvK2ZjcM6a4/8X7lx+HVMXnfxRfcFRePynIFWeDlXpasrvLA+o6e93pMIzZhOJYSg2ccqKgu8aw6khVzWzk6n8SSLh5ZRGx3but4l3JEaPYGQhFvaUTHjpZA2rj02pnoG8jRZ2A= ; Message-ID: <20060912192628.63526.qmail@web53510.mail.yahoo.com> Received: from [196.38.142.117] by web53510.mail.yahoo.com via HTTP; Tue, 12 Sep 2006 12:26:27 PDT Date: Tue, 12 Sep 2006 12:26:27 -0700 (PDT) From: Allan Kamau Subject: Re: Combining output of several fields in SQL query To: Aaron Bono Cc: pgsql-admin@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.185 tagged_above=0 required=5 tests=AWL X-Spam-Level: * X-Archive-Number: 200609/102 X-Sequence-Number: 23016 create table tableA( s_l_p_p_v_i text not null, field1 text not null, field2 text not null, primary key(field1,field2)); s_l_p_p_v_i field1 field1 abc 2 1 xyz 2 4 klm 2 3 --- Aaron Bono wrote: > On 9/12/06, Allan Kamau > wrote: > > > > Hi all, > > This is a plain simple sql question appologies for > > posting it here. > > > > Am looking for a way of combining values from > several > > fields(and introducting value separators). > > > > select field2+"_"+field1 from tableA; > > > > I've tried > > select field2||'_'||field1 from tableA; > > I get "1" as the result(which is not what I want). > > > > What does tableA look like (DDL and the data)? > > ================================================================== > Aaron Bono > Aranya Software Technologies, Inc. > http://www.aranya.com > http://codeelixir.com > ================================================================== > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com