This is a discussion on update with join within the MySQL forums, part of the Database Server Software category; --> On Wed, 05 Dec 2007 12:55:37 +0100, Michele <nomail@nomail.it> wrote: > Where is the error in this update with ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| On Wed, 05 Dec 2007 12:55:37 +0100, Michele <nomail@nomail.it> wrote: > Where is the error in this update with join > > update snx_comuni set sta_id = 2782 > from snx_comuni Euhm, no FROM, you don't update FROM. > inner join snx_province on snx_comuni.provincia_id = > snx_province.provincia_id > inner join snx_regioni on snx_province.regione_id = > snx_regioni.regione_id > where snx_regioni.codice_regione = 'PIE' Try this, and if it doesn't work, tell us what MySQL sais the error is: update snx_comuni inner join snx_province on snx_comuni.provincia_id = snx_province.provincia_id inner join snx_regioni on snx_province.regione_id = snx_regioni.regione_id set snx_comuni.sta_id = 2782 where snx_regioni.codice_regione = 'PIE' -- Rik Wasmus |
| |||
| On 5 Dec, 11:55, Michele <nom...@nomail.it> wrote: > Where is the error in this update with join > > update snx_comuni set sta_id = 2782 > from snx_comuni > inner join snx_province on snx_comuni.provincia_id = > snx_province.provincia_id > inner join snx_regioni on snx_province.regione_id = snx_regioni.regione_id > where snx_regioni.codice_regione = 'PIE' MySQL will have told you. Even if you didn't understand it, telling us what MuSQL told you would seem sensible, don't you think! |
| Thread Tools | |
| Display Modes | |
|
|