Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id C9D3E63475C for ; Fri, 13 Mar 2009 04:36:55 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 86754-08 for ; Fri, 13 Mar 2009 04:36:46 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail2.Synechron.com (mail2.synechron.com [220.225.40.41]) by mail.postgresql.org (Postfix) with ESMTP id 33D04633626 for ; Fri, 13 Mar 2009 04:36:41 -0300 (ADT) Received: from [10.31.15.20] [10.31.15.20] by mail2.Synechron.com with ESMTP (SMTPD-9.10) id AD30317BCC; Fri, 13 Mar 2009 13:07:20 +0530 Message-ID: <49BA0D03.3060005@synechron.com> Date: Fri, 13 Mar 2009 13:06:35 +0530 From: Ashish Karalkar User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: suresh gupta CC: pgsql-admin@postgresql.org Subject: Re: Query related References: <004001c9a3a9$9e715dc0$cd64290a@ind.zensar.com> In-Reply-To: <004001c9a3a9$9e715dc0$cd64290a@ind.zensar.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.477 tagged_above=0 required=5 tests=AWL=0.046, DNS_FROM_OPENWHOIS=2.431 X-Spam-Level: ** X-Archive-Number: 200903/158 X-Sequence-Number: 31658 suresh gupta wrote: > Hi Team, > > I had a table with 2 fields like First name(FN) and last name(LN). > When I give a query for the records of the 2 columns, they are > displaying in 2 different columns. My requirement is to combine both > the columns in a single one. As per my knowledge there are some > operators which combine 2 columns and display together in single > columns like |, +, etc. in other databases like Oracle. > For example FN = Suresh and LN=Gupta the output of the query should be > Suresh Gupta in single column. > > Is there any similar operator or method on postgresql to get my > result. Please advice. > > Pgsql version is 8.1 and window version software. > > > Regards, > *G. V. Suresh Gupta* > ------------------------------------------------------------------------ > *GTS - EMEIA, Zensar Technologies * > Zensar Knowledge Park, Plot#5, MIDC IT Tower, > Kharadi, Off Nagar Road, Pune - 411014 > Landline : +91-20-66453471 | +91-9890898688 > Email : suresh.g@zensar.com | website: > www.zensar.com > > DISCLAIMER: > This email may contain confidential or privileged information for the > intended recipient(s) and the views expressed in the same are not > necessarily the views of Zensar Technologies Ltd. If you are not the > intended recipient or have received this e-mail by error, its use is > strictly prohibited, please delete the e-mail and notify the sender. > Zensar Technologies Ltd. does not accept any liability for virus > infected mails. > This will help you. postgres=# create table name(fn text,ln text); CREATE TABLE postgres=# insert into name values ('abc','xyz'); INSERT 0 1 postgres=# select * from name; fn | ln -----+----- abc | xyz (1 row) postgres=# select fn||' '||ln as name from name; name --------- abc xyz (1 row)