From: | "Michael Ansley (UK)" <Michael(dot)Ansley(at)intec-telecom-systems(dot)com> |
---|---|
To: | "'Fredrik Thunberg'" <fredrik(at)datessa(dot)se>, pgsql-sql(at)postgresql(dot)org |
Subject: | RE: Simple SQL-syntax |
Date: | 2001-08-20 15:33:00 |
Message-ID: | 7F124BC48D56D411812500D0B747251480F67E@fileserver002.intecsystems.co.uk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
-----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(at)datessa(dot)se]
Sent: 20 August 2001 12:16
To: pgsql-sql(at)postgresql(dot)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-----
From | Date | Subject | |
---|---|---|---|
Next Message | Josh Berkus | 2001-08-20 16:34:28 | Re: SQL Statement too long |
Previous Message | Josh Berkus | 2001-08-20 15:13:05 | Re: Simple SQL-syntax |