Re: Update table1 from table2

2002-04-26 Thread Donna Robinson
Hi, I am using MySql Ver ll.15 distrib. 3.23.41 I want to write an sql query something like: update ddata set ddata.pubkey = pubdata.pubkey, ddata.title=pubdata.title where ddata.dkey=pubdata.dkey; This generates an error: ERROR 1109: Unknown table 'pubdata' in where clause and using thi

Update table1 from table2

2002-04-25 Thread Donna Robinson
Hi, I am sure this is an old chestnut, but a web search has revealed no answers. I have: table pubdata ( dkey smallint(5) unsigned NOT NULL default '0', pubkey smallint(5) unsigned NOT NULL default '0', title varchar(100) NOT NULL default '' )"; table ddata ( dkey smallint(5) unsigned NOT NULL

Update table1 from table2

2002-04-25 Thread Donna Robinson
Hi, I am sure this is an old chestnut, but a web search has revealed no answers. I have: table pubdata ( dkey smallint(5) unsigned NOT NULL default '0', pubkey smallint(5) unsigned NOT NULL default '0', title varchar(100) NOT NULL default '' )"; table ddata ( dkey smallint(5) unsigned NOT NULL

UPDATE table1 FROM table2

2001-12-16 Thread Michael Widenius
Hi! I just happend to notice this old email... > "Moshe" == Moshe Gurvich <[EMAIL PROTECTED]> writes: Moshe> In MySQL 3.23, how to update one table using information from another table. Moshe> update table1 set value1=t2.value2 Moshe> from table1 as t inner join table2 as t1 using(pk_key)

RE: UPDATE table1 FROM table2

2001-11-02 Thread Steve Meyers
On Fri, 2001-11-02 at 09:57, Paul DuBois wrote: > At 9:47 AM -0700 11/2/01, Steve Meyers wrote: > >That's a dangerous solution. If there are more columns in test2 than ID > >and Value, the REPLACE will delete those values. As you noted in the > >manual, the old record is deleted before the new r

RE: UPDATE table1 FROM table2

2001-11-02 Thread Paul DuBois
At 9:47 AM -0700 11/2/01, Steve Meyers wrote: >That's a dangerous solution. If there are more columns in test2 than ID >and Value, the REPLACE will delete those values. As you noted in the >manual, the old record is deleted before the new record is inserted. > >Multi-table updates should happen

RE: UPDATE table1 FROM table2

2001-11-02 Thread Steve Meyers
That's a dangerous solution. If there are more columns in test2 than ID and Value, the REPLACE will delete those values. As you noted in the manual, the old record is deleted before the new record is inserted. Multi-table updates should happen in 4.1, I think, which is due out fairly soon. If

RE: UPDATE table1 FROM table2

2001-11-02 Thread Rick Emery
AM To: [EMAIL PROTECTED] Subject: UPDATE table1 FROM table2 In MySQL 3.23, how to update one table using information from another table. update table1 set value1=t2.value2 from table1 as t inner join table2 as t1 using(pk_key) ??? or update table1 as t1 inner join table2 as t2 using(pk_key)

UPDATE table1 FROM table2

2001-11-02 Thread Moshe Gurvich
In MySQL 3.23, how to update one table using information from another table. update table1 set value1=t2.value2 from table1 as t inner join table2 as t1 using(pk_key) ??? or update table1 as t1 inner join table2 as t2 using(pk_key) set t1.value1=t2.value2 ??? Is it possible at all? Thank you