Re: Simple SQL-syntax - Mailing list pgsql-sql

From Jeff Eckermann
Subject Re: Simple SQL-syntax
Date
Msg-id 01af01c12984$80c48830$279c10ac@INTERNAL
Whole thread Raw
In response to Simple SQL-syntax  ("Fredrik Thunberg" <fredrik@datessa.se>)
List pgsql-sql
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 -----
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

pgsql-sql by date:

Previous
From: "Joseph Syjuco"
Date:
Subject: user defined function question
Next
From: "Josh Berkus"
Date:
Subject: Re: SQL Statement too long