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

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
Funny you should ask that. There was a similar questoin answer on the PH-DB mailing list (different poster, though) Answer is: REPLACE INTO test2 (test2.ID, test2.Value) SELECT test1.ID, test1.Value FROM test1 WHERE test1.ID LIKE '1' >From manual: "...REPLACE works exactly like INSERT,