Hi i ve got two tables like this:
mysql> describe tb_data_iae;
+--------------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------------------+--------------+------+-----+---------+----------------+
| id_dialecte | int(11) | NO | PRI | NULL | auto_increment |
| nb_champs | tinyint(4) | NO | | 0 | |
+--------------------+--------------+------+-----+---------+----------------+
and
mysql> describe tb_dialecte;
+-------------------+--------------+------+-----+------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------------+--------------+------+-----+------------+----------------+
| id_dialecte | int(11) | NO | PRI | NULL | auto_increment |
| nb_champs | tinyint(4) | NO | | 0 | |
+-------------------+--------------+------+-----+------------+----------------+
I try to update first table "nb_champs" field from the same field coming from the second table
mysql> update tb_data_iae
set nb_champs=tb_dialecte.nbchamps
from tb_dialecte
where tb_dialecte.id_dialecte = tb_data_iae.id_dialecte;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from tb_dialecte where tb_dialecte.id_dialecte = tb_data_iae.id_dialecte' at line 1
I don't know how to debug this, as I try many queries but no ones works and the error message is pretty much the same everytime as the one above...
Thx for help !