Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id C9423B5DC49 for ; Thu, 25 Aug 2011 11:52:11 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 72372-02 for ; Thu, 25 Aug 2011 14:52:04 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from hermes.marktest.pt (iota.marktest.pt [80.251.174.118]) by mail.postgresql.org (Postfix) with ESMTP id 89545B5DC02 for ; Thu, 25 Aug 2011 11:52:04 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by hermes.marktest.pt (Postfix) with ESMTP id A45911A82D1; Thu, 25 Aug 2011 15:52:03 +0100 (WEST) X-Virus-Scanned: amavisd-new at marktest.pt Received: from hermes.marktest.pt ([127.0.0.1]) by localhost (hermes.marktest.pt [127.0.0.1]) (amavisd-new, port 11124) with ESMTP id cPGNAhwe+iIZ; Thu, 25 Aug 2011 15:52:03 +0100 (WEST) Received: from Proteu (proteu.marktest.pt [10.61.90.54]) by hermes.marktest.pt (Postfix) with ESMTP id 7C3561A82CA; Thu, 25 Aug 2011 15:52:03 +0100 (WEST) Message-ID: <0D887B9957604C82AE742AC437E8AF0A@marktestcr.marktest.pt> From: "Oliveiros d'Azevedo Cristina" To: "gvim" , "pgsql sql" References: <4E565A4E.9060400@gmail.com> Subject: Re: Add one column to another Date: Thu, 25 Aug 2011 15:52:03 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.432 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.532 X-Spam-Level: X-Archive-Number: 201108/106 X-Sequence-Number: 35774 Something like this...? SELECT first_name,surname, email1 || ';' || email2 FROM t_your_table; Best, Oliver ----- Original Message ----- From: "gvim" To: "pgsql sql" Sent: Thursday, August 25, 2011 3:21 PM Subject: [SQL] Add one column to another >I have to deal with a table which contains: > > first_name > surname > email1 > email2 > > ... and I would like to create a view which combines both email columns > thus: > > first_name > surname > email > > It looks simple but I can't think of an obvious query. > > gvim > > -- > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql