Re: [SQL] Add one column to another

2011-08-25 Thread vipul shah
Check this link. It's useful to resolve the issue. http://blog.ropardo.ro/2010/05/04/extending-postgresql-a-better-concat-operator/ - Vipul On Thu, Aug 25, 2011 at 12:54 PM, Scott Marlowe wrote: > On Thu, Aug 25, 2011 at 8:52 AM, Oliveiros d'Azevedo Cristina > wrote: > > Something like this.

Re: [SQL] Add one column to another

2011-08-25 Thread Scott Marlowe
On Thu, Aug 25, 2011 at 8:52 AM, Oliveiros d'Azevedo Cristina wrote: > Something like this...? > > SELECT first_name,surname, email1 || ';' || email2 > FROM t_your_table; If there's any nulls in email1 or email2 they'll need special handling with coalesce. -- Sent via pgsql-sql mailing list (pg

Re: [SQL] Add one column to another

2011-08-25 Thread Tim Landscheidt
(anonymous) wrote: > 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. Try: | SELECT firs

Re: [SQL] Add one column to another

2011-08-25 Thread David Johnston
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. ---

Re: [SQL] Add one column to another

2011-08-25 Thread Oliveiros d'Azevedo Cristina
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 h

Re: [SQL] Add one column to another

2011-08-25 Thread Tony Capobianco
Use the concat || operator. On Thu, 2011-08-25 at 15:21 +0100, gvim wrote: > 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 s

[SQL] Add one column to another

2011-08-25 Thread gvim
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@postgr