|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi all! I'm working on a MySql 3.23.58 and i need to do a multiplate
table UPDATE. I need something equivalent to: UPDATE table1 INNER JOIN tabl2 USING(id1) INNER JOIN table3 ON table1.id1 = table3.id3 SET table2.acquisition_price = REPLACE(table3.field3, ',', '.'); Any suggestion? Thank you |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On 16 Oct, 10:14, "gianpaolo.pelloni" <gianpaolo.pell...@tin.it>
wrote: > Hi all! I'm working on a MySql 3.23.58 and i need to do a multiplate > table UPDATE. > > I need something equivalent to: > > UPDATE table1 INNER JOIN tabl2 USING(id1) INNER JOIN table3 ON > table1.id1 = table3.id3 SET table2.acquisition_price = > REPLACE(table3.field3, ',', '.'); > > Any suggestion? > > Thank you Well, the manual that says it covers 3.23, 4.0, 4.1 states that multi table updates are valid, so I suggest you go ahead and do it. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On 16 Ott, 11:56, Captain Paralytic <paul_laut...@yahoo.com> wrote:
> On 16 Oct, 10:14, "gianpaolo.pelloni" <gianpaolo.pell...@tin.it> > wrote: > > > Hi all! I'm working on a MySql 3.23.58 and i need to do a multiplate > > table UPDATE. > > > I need something equivalent to: > > > UPDATE table1 INNER JOIN tabl2 USING(id1) INNER JOIN table3 ON > > table1.id1 = table3.id3 SET table2.acquisition_price = > > REPLACE(table3.field3, ',', '.'); > > > Any suggestion? > > > Thank you > > Well, the manual that says it covers 3.23, 4.0, 4.1 states that multi > table updates are valid, so I suggest you go ahead and do it. I've read the manual, but when i try to tun the query, i get this error: You have an error in your SQL syntax near 'INNER JOIN table2 ...' at line 1 in Further more, i've searched online the manual for 3.23 version of mysql http://www.science.uva.nl/ict/ossdoc...ce.html#UPDATE where you can read the exact syntax: UPDATE [LOW_PRIORITY] [IGNORE] tbl_name SET col_name1=expr1, [col_name2=expr2, ...] [WHERE where_definition] [ORDER BY ...] [LIMIT #] There are no joins available. So i need a way to do that query above not using any kind of JOIN statement. I need to update something like 8000 records, and i don't wanto to do that by hand on with 8000 different queries.. Any idea? Thanks for your reply Captain Paralytic |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On 16 Oct, 11:10, gianpaolo <gianpaolo.pell...@tin.it> wrote:
> On 16 Ott, 11:56, Captain Paralytic <paul_laut...@yahoo.com> wrote: > > > > > > > On 16 Oct, 10:14, "gianpaolo.pelloni" <gianpaolo.pell...@tin.it> > > wrote: > > > > Hi all! I'm working on a MySql 3.23.58 and i need to do a multiplate > > > table UPDATE. > > > > I need something equivalent to: > > > > UPDATE table1 INNER JOIN tabl2 USING(id1) INNER JOIN table3 ON > > > table1.id1 = table3.id3 SET table2.acquisition_price = > > > REPLACE(table3.field3, ',', '.'); > > > > Any suggestion? > > > > Thank you > > > Well, the manual that says it covers 3.23, 4.0, 4.1 states that multi > > table updates are valid, so I suggest you go ahead and do it. > > I've read the manual, but when i try to tun the query, i get this > error: > You have an error in your SQL syntax near 'INNER JOIN table2 ...' at > line 1 in > > Further more, i've searched online the manual for 3.23 version of > mysqlhttp://www.science.uva.nl/ict/ossdocs/mysql/manual_Reference.html#UPDATE > where you can read the exact syntax: > > UPDATE [LOW_PRIORITY] [IGNORE] tbl_name > SET col_name1=expr1, [col_name2=expr2, ...] > [WHERE where_definition] > [ORDER BY ...] > [LIMIT #] > > There are no joins available. > So i need a way to do that query above not using any kind of JOIN > statement. > I need to update something like 8000 records, and i don't wanto to do > that by hand on with 8000 different queries.. > > Any idea? > > Thanks for your reply Captain Paralytic- Hide quoted text - > > - Show quoted text - Now we are getting somewhere. Since eyou are using such an old and unsupported version of MySQL, when I looked in the "official" manual and it said that what you were doing was fine, I could tell you no more. If you post a query and that query is failing when you run it, ALWAYS post the error that you are seeing. We do not have crystal balls that show us what you don't post. I was going to suggest a 2 stage process using a temporary table and the ON DUPLIATE KEY option of INSERT, but that document that you found suggests that this too is not available. How about moving the tables to a MySQL 4 or 5 installation, doing the update and them moving them back. Or even better, upgrade MySQL! |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
On 16 Ott, 12:40, Captain Paralytic <paul_laut...@yahoo.com> wrote:
> On 16 Oct, 11:10, gianpaolo <gianpaolo.pell...@tin.it> wrote: > > > > > On 16 Ott, 11:56, Captain Paralytic <paul_laut...@yahoo.com> wrote: > > > > On 16 Oct, 10:14, "gianpaolo.pelloni" <gianpaolo.pell...@tin.it> > > > wrote: > > > > > Hi all! I'm working on a MySql 3.23.58 and i need to do a multiplate > > > > table UPDATE. > > > > > I need something equivalent to: > > > > > UPDATE table1 INNER JOIN tabl2 USING(id1) INNER JOIN table3 ON > > > > table1.id1 = table3.id3 SET table2.acquisition_price = > > > > REPLACE(table3.field3, ',', '.'); > > > > > Any suggestion? > > > > > Thank you > > > > Well, the manual that says it covers 3.23, 4.0, 4.1 states that multi > > > table updates are valid, so I suggest you go ahead and do it. > > > I've read the manual, but when i try to tun the query, i get this > > error: > > You have an error in your SQL syntax near 'INNER JOIN table2 ...' at > > line 1 in > > > Further more, i've searched online the manual for 3.23 version of > > mysqlhttp://www.science.uva.nl/ict/ossdocs/mysql/manual_Reference.html#UPDATE > > where you can read the exact syntax: > > > UPDATE [LOW_PRIORITY] [IGNORE] tbl_name > > SET col_name1=expr1, [col_name2=expr2, ...] > > [WHERE where_definition] > > [ORDER BY ...] > > [LIMIT #] > > > There are no joins available. > > So i need a way to do that query above not using any kind of JOIN > > statement. > > I need to update something like 8000 records, and i don't wanto to do > > that by hand on with 8000 different queries.. > > > Any idea? > > > Thanks for your reply Captain Paralytic- Hide quoted text - > > > - Show quoted text - > > Now we are getting somewhere. Since eyou are using such an old and > unsupported version of MySQL, when I looked in the "official" manual > and it said that what you were doing was fine, I could tell you no > more. > > If you post a query and that query is failing when you run it, ALWAYS > post the error that you are seeing. We do not have crystal balls that > show us what you don't post. > > I was going to suggest a 2 stage process using a temporary table and > the ON DUPLIATE KEY option of INSERT, but that document that you found > suggests that this too is not available. > > How about moving the tables to a MySQL 4 or 5 installation, doing the > update and them moving them back. Or even better, upgrade MySQL! Now it seems that the only solution is to upgrade database, because i need to run that kind of queries once a day. Thank you for your reply Captain Paralytic, and I'm sorry for being novice |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
On 16 Oct, 12:01, gianpaolo <gianpaolo.pell...@tin.it> wrote:
> On 16 Ott, 12:40, Captain Paralytic <paul_laut...@yahoo.com> wrote: > > > > > > > On 16 Oct, 11:10, gianpaolo <gianpaolo.pell...@tin.it> wrote: > > > > On 16 Ott, 11:56, Captain Paralytic <paul_laut...@yahoo.com> wrote: > > > > > On 16 Oct, 10:14, "gianpaolo.pelloni" <gianpaolo.pell...@tin.it> > > > > wrote: > > > > > > Hi all! I'm working on a MySql 3.23.58 and i need to do a multiplate > > > > > table UPDATE. > > > > > > I need something equivalent to: > > > > > > UPDATE table1 INNER JOIN tabl2 USING(id1) INNER JOIN table3 ON > > > > > table1.id1 = table3.id3 SET table2.acquisition_price = > > > > > REPLACE(table3.field3, ',', '.'); > > > > > > Any suggestion? > > > > > > Thank you > > > > > Well, the manual that says it covers 3.23, 4.0, 4.1 states that multi > > > > table updates are valid, so I suggest you go ahead and do it. > > > > I've read the manual, but when i try to tun the query, i get this > > > error: > > > You have an error in your SQL syntax near 'INNER JOIN table2 ...' at > > > line 1 in > > > > Further more, i've searched online the manual for 3.23 version of > > > mysqlhttp://www.science.uva.nl/ict/ossdocs/mysql/manual_Reference.html#UPDATE > > > where you can read the exact syntax: > > > > UPDATE [LOW_PRIORITY] [IGNORE] tbl_name > > > SET col_name1=expr1, [col_name2=expr2, ...] > > > [WHERE where_definition] > > > [ORDER BY ...] > > > [LIMIT #] > > > > There are no joins available. > > > So i need a way to do that query above not using any kind of JOIN > > > statement. > > > I need to update something like 8000 records, and i don't wanto to do > > > that by hand on with 8000 different queries.. > > > > Any idea? > > > > Thanks for your reply Captain Paralytic- Hide quoted text - > > > > - Show quoted text - > > > Now we are getting somewhere. Since eyou are using such an old and > > unsupported version of MySQL, when I looked in the "official" manual > > and it said that what you were doing was fine, I could tell you no > > more. > > > If you post a query and that query is failing when you run it, ALWAYS > > post the error that you are seeing. We do not have crystal balls that > > show us what you don't post. > > > I was going to suggest a 2 stage process using a temporary table and > > the ON DUPLIATE KEY option of INSERT, but that document that you found > > suggests that this too is not available. > > > How about moving the tables to a MySQL 4 or 5 installation, doing the > > update and them moving them back. Or even better, upgrade MySQL! > > Now it seems that the only solution is to upgrade database, because i > need to run that kind of queries once a day. > > Thank you for your reply Captain Paralytic, and I'm sorry for being > novice- Hide quoted text - > > - Show quoted text - No need to apologise for being a novice, but even a novice should be able to realise that they ned to give enough information to identify the problem. |
|
![]() |
| Outils de la discussion | |
|
|