Received: from fileserver002.intecsystems.co.uk ([194.200.14.125]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f7KFWVP59729 for ; Mon, 20 Aug 2001 11:32:31 -0400 (EDT) (envelope-from Michael.Ansley@intec-telecom-systems.com) Received: from fileserver002.intecsystems.co.uk (unverified) by fileserver002.intecsystems.co.uk (Content Technologies SMTPRS 4.1.5) with ESMTP id ; Mon, 20 Aug 2001 16:33:01 +0100 Received: by fileserver002.intecsystems.co.uk with Internet Mail Service (5.5.2650.21) id ; Mon, 20 Aug 2001 16:33:01 +0100 Message-ID: <7F124BC48D56D411812500D0B747251480F67E@fileserver002.intecsystems.co.uk> From: "Michael Ansley (UK)" To: "'Fredrik Thunberg'" , pgsql-sql@postgresql.org Subject: RE: Simple SQL-syntax Date: Mon, 20 Aug 2001 16:33:00 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: multipart/alternative ; boundary="----_=_NextPart_001_01C1298D.6548E28C" X-Archive-Number: 200108/246 X-Sequence-Number: 4485 This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C1298D.6548E28C Content-Type: text/plain; charset="iso-8859-1" -----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 iQA/AwUBO4EtanympNV/C086EQKOMwCbBLcLCUJYK5gWvOROp2IbV0+IkC4An1gN 0Bys7MmGO9C6S6o8nt1YPwRQ =Vhvj -----END PGP SIGNATURE----- ------_=_NextPart_001_01C1298D.6548E28C Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable RE: [SQL] Simple SQL-syntax

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Probably something like:
 
UPDATE tableA SET tableA.nrA =3D (SELECT B.nrB FROM tabl= eB B WHERE
tableA.nrA =3D 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:<= /FONT>
 
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 t= o NrB...
 
I've tried:
 
UPDATE tableA Set tableA.nrA =3D B.nrB From tableB B Whe= re tableA.nrA =3D
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+Ik= C4An1gN
0Bys7MmGO9C6S6o8nt1YPwRQ
=3DVhvj
-----END PGP SIGNATURE-----



_________________________________________________________________________ This e-mail and any attachments are confidential and may also be privileged= and/or copyright
material of Intec Telecom Systems PLC (or its affiliated companies). If yo= u are not an
intended or authorised recipient of this e-mail or have received it in erro= r, please delete
it immediately and notify the sender by e-mail. In such a case, reading, r= eproducing,
printing or further dissemination of this e-mail is strictly prohibited and= may be unlawful.
Intec Telecom Systems PLC. does not represent or warrant that an attachment= hereto is free
from computer viruses or other defects. The opinions expressed in this e-ma= il and any
attachments may be those of the author and are not necessarily those of Int= ec Telecom
Systems PLC.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
__________________________________________________________________________<= BR>
------_=_NextPart_001_01C1298D.6548E28C--