From: Michael Ansley (UK) <Michael.Ansley@intec-telecom-systems.com>
To: 'Fredrik Thunberg' <fredrik@datessa.se>
To: pgsql-sql@postgresql.org
Subject: RE: Simple SQL-syntax
Date: Mon, 20 Aug 2001 16:33:00 +0100
Message-ID: <7F124BC48D56D411812500D0B747251480F67E@fileserver002.intecsystems.co.uk> (raw)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Probably something like:
UPDATE tableA SET tableA.nrA = (SELECT B.nrB FROM tableB B WHERE
tableA.nrA = B.nrA);
Let me know...
MikeA
- -----Original Message-----
From: Fredrik Thunberg [mailto:fredrik@datessa.se]
Sent: 20 August 2001 12:16
To: pgsql-sql@postgresql.org
Subject: [SQL] Simple SQL-syntax
Hello.
I have a very simple sql-question from an sql-beginner:
Suppose I have Table A looking something like this:
Index Text NrA
And Table B like this:
NrA NrB
Then I want to change all occurences of NrA in Table A to NrB...
I've tried:
UPDATE tableA Set tableA.nrA = B.nrB From tableB B Where tableA.nrA =
B.nrA;
But that doesn't seem to work...
Best regards
/Fredrik Thunberg
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.3 for non-commercial use <http://www.pgp.com;
iQA/AwUBO4EtanympNV/C086EQKOMwCbBLcLCUJYK5gWvOROp2IbV0+IkC4An1gN
0Bys7MmGO9C6S6o8nt1YPwRQ
=Vhvj
-----END PGP SIGNATURE-----
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: Michael.Ansley@intec-telecom-systems.com, fredrik@datessa.se
Subject: Re: Simple SQL-syntax
In-Reply-To: <7F124BC48D56D411812500D0B747251480F67E@fileserver002.intecsystems.co.uk>
References: <7F124BC48D56D411812500D0B747251480F67E@fileserver002.intecsystems.co.uk>
* 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