Re: Add one column to another

From: "David Johnston" <polobo(at)yahoo(dot)com>
To: "'gvim'" <gvimrc(at)gmail(dot)com>, "'pgsql sql'" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Add one column to another
Date: 2011-08-25 14:53:33
Message-ID: 021201cc6336$c3547e20$49fd7a60$@yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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.

-----------------------------------------------------------

SELECT first_name, surname, ARRAY[email1, email2] AS email
FROM [...]

David J.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tim Landscheidt 2011-08-25 17:50:14 Re: Add one column to another
Previous Message Oliveiros d'Azevedo Cristina 2011-08-25 14:52:03 Re: Add one column to another