From: malia, sean <malia_sean@emc.com>
To: 'pgsql-sql@postgresql.org' <pgsql-sql@postgresql.org>
Subject: Re: DB question - Merging data from one table to another.
Date: Thu, 1 Apr 2004 10:27:32 -0500
Message-ID: <F98A1E742671C244BE48E009FD29647B03DA2803@srtittle.eng.emc.com> (raw)
Hello,
I'm not sure if this is even possible, but I'll throw it by you anyway.
Say I have 2 tables:
Table1: With columns number and name
1.1 test1
1.2 test2
1.3 test3
1.4 test4
Table2: With column number and results
1.1 pass
1.2 fail
1.3 pass
1.4 fail
What I would like to do is add a new column to Table2 called name and
populate the name from table 1 and add it to table 2. So, table 2 will look
like:
1.1 pass test1
1.2 fail test2
1.3 pass test3
1.4 fail test4
**NOTE: in same cases if you do a "select name from table1 where
number='1.1'" you might get multiple matches, I guess we would need to use
"distinct" ?
I've never interacted two tables before, so I'm not even sure where to start
with this.
I'm using postgres 7.4.
Thanks all.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: malia_sean@emc.com
Subject: Re: DB question - Merging data from one table to another.
In-Reply-To: <F98A1E742671C244BE48E009FD29647B03DA2803@srtittle.eng.emc.com>
References: <F98A1E742671C244BE48E009FD29647B03DA2803@srtittle.eng.emc.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox