RE: Simple SQL-syntax - Mailing list pgsql-sql
From | Michael Ansley (UK) |
---|---|
Subject | RE: Simple SQL-syntax |
Date | |
Msg-id | 7F124BC48D56D411812500D0B747251480F67E@fileserver002.intecsystems.co.uk Whole thread Raw |
In response to | Simple SQL-syntax ("Fredrik Thunberg" <fredrik@datessa.se>) |
List | pgsql-sql |
<p><font size="2">-----BEGIN PGP SIGNED MESSAGE-----</font><br /><font size="2">Hash: SHA1</font><p><font size="2">Probablysomething like:</font><br /><font size="2"> </font><br /><font size="2">UPDATE tableA SET tableA.nrA = (SELECTB.nrB FROM tableB B WHERE</font><br /><font size="2">tableA.nrA = B.nrA);</font><br /><font size="2"> </font><br /><fontsize="2">Let me know...</font><br /><font size="2"> </font><br /><font size="2"> </font><br /><font size="2">MikeA</font><br/><font size="2"> </font><br /><font size="2"> </font><p><font size="2">- -----Original Message-----</font><br/><font size="2">From: Fredrik Thunberg [<a href="mailto:fredrik@datessa.se">mailto:fredrik@datessa.se</a>]</font><br/><font size="2">Sent: 20 August 2001 12:16</font><br/><font size="2">To: pgsql-sql@postgresql.org</font><br /><font size="2">Subject: [SQL] Simple SQL-syntax</font><br/><p><font size="2">Hello.</font><br /><font size="2"> </font><br /><font size="2">I have a very simplesql-question from an sql-beginner:</font><br /><font size="2"> </font><br /><font size="2">Suppose I have Table A lookingsomething like this:</font><br /><font size="2"> </font><br /><font size="2">Index Text NrA</font><br /><fontsize="2"> </font><br /><font size="2">And Table B like this:</font><br /><font size="2"> </font><br /><font size="2">NrA NrB</font><br /><font size="2"> </font><br /><font size="2">Then I want to change all occurences of NrA inTable A to NrB...</font><br /><font size="2"> </font><br /><font size="2">I've tried:</font><br /><font size="2"> </font><br/><font size="2">UPDATE tableA Set tableA.nrA = B.nrB From tableB B Where tableA.nrA =</font><br /><fontsize="2">B.nrA;</font><br /><font size="2"> </font><br /><font size="2">But that doesn't seem to work...</font><br/><font size="2"> </font><br /><font size="2">Best regards</font><br /><font size="2"> </font><br /><fontsize="2">/Fredrik Thunberg</font><br /><p><font size="2">-----BEGIN PGP SIGNATURE-----</font><br /><font size="2">Version:PGPfreeware 6.5.3 for non-commercial use <<a href="http://www.pgp.com" target="_blank">http://www.pgp.com</a>></font><p><font size="2">iQA/AwUBO4EtanympNV/C086EQKOMwCbBLcLCUJYK5gWvOROp2IbV0+IkC4An1gN</font><br/><font size="2">0Bys7MmGO9C6S6o8nt1YPwRQ</font><br/><font size="2">=Vhvj</font><br /><font size="2">-----END PGP SIGNATURE-----</font><code><fontsize="3"><br /><br /> _________________________________________________________________________<br/> This e-mail and any attachments are confidentialand may also be privileged and/or copyright <br /> material of Intec Telecom Systems PLC (or its affiliated companies).If you are not an <br /> intended or authorised recipient of this e-mail or have received it in error, pleasedelete <br /> it immediately and notify the sender by e-mail. In such a case, reading, reproducing, <br /> printingor further dissemination of this e-mail is strictly prohibited and may be unlawful. <br /> Intec Telecom SystemsPLC. does not represent or warrant that an attachment hereto is free <br /> from computer viruses or other defects.The opinions expressed in this e-mail and any <br /> attachments may be those of the author and are not necessarilythose of Intec Telecom <br /> Systems PLC. <br /><br /> This footnote also confirms that this email message hasbeen swept by<br /> MIMEsweeper for the presence of computer viruses. <br /> __________________________________________________________________________<br/></font></code>