Duplicating values (cf keys) in tables involves de-normalisation and is therefore not 
recommended.

Your observation row cf column is correct. I felt the question was sufficiently broad 
to risk interpreting
"update" as wider than "UPDATE", sorry - the other response seemed to hit that nail on 
the head (have deleted
it).

If it doesn't suit, then another solution might be to use PHP to SELECT the data from 
table1 and then use a
second query to UPDATE table-2 SET table2-col = table1-col WHERE table1-val = 
table2-val (which, in its present
form, has the potential to modify numerous rows in one hit).

=Regards,
=dn


> thanks for that, but that will add a row as opposed to updating a column
> won't it?
> I don't want to insert a new row.
> All I want to do is update a value in table1 if it is present in table2
>
> cheers
> Rich
>
> >From: "DL Neil" <[EMAIL PROTECTED]>
> >Reply-To: "DL Neil" <[EMAIL PROTECTED]>
> >To: "Richard Dobson" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
> >Subject: Re: update from table x to table y
> >Date: Tue, 13 Nov 2001 11:45:45 -0000
> >
> > > Hi does anyone know of a way of taking some data from one table and
> >updating
> > > another table with it?
> > >
> > > If MySQL doesn't support it i'm gonna have to go back to Access or
> > > something!
> >
> >
> >Rich
> >
> >=only "go back" to Access if you're a glutton for punishment!
> >
> >=try MySQL/HTMLmanual/manual_Reference.html#INSERT_SELECT
> >
> >=dn
> >
> >
> >
> >---------------------------------------------------------------------
> >Before posting, please check:
> >    http://www.mysql.com/manual.php   (the manual)
> >    http://lists.mysql.com/           (the list archive)
> >
> >To request this thread, e-mail <[EMAIL PROTECTED]>
> >To unsubscribe, e-mail
> ><[EMAIL PROTECTED]>
> >Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> >
>
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to