From: Jeff Eckermann <jeckermann@verio.net>
To: Fredrik Thunberg <fredrik@datessa.se>
To: pgsql-sql@postgresql.org
Subject: Re: Simple SQL-syntax
Date: Mon, 20 Aug 2001 09:29:21 -0500
Message-ID: <01af01c12984$80c48830$279c10ac@INTERNAL> (raw)
References: <01a501c12969$6e397a10$7100000a@intern.datessa.se>
UPDATE TableA SET nrA = TableB.nrB WHERE nrA = TableB.nrA;
UPDATE statements don't take FROM clauses. I don't think they like aliasing, either.
----- Original Message -----
From: Fredrik Thunberg
To: pgsql-sql@postgresql.org
Sent: Monday, August 20, 2001 6:15 AM
Subject: 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
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: jeckermann@verio.net, fredrik@datessa.se
Subject: Re: Simple SQL-syntax
In-Reply-To: <01af01c12984$80c48830$279c10ac@INTERNAL>
* 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