Hi, I have two tables:
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 am trying to update the field of the first table "nb_champs" from the same field that appears in 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 the SQL syntax; check the manual that matches your version of MySQL server for the correct syntax to use next to 'tb_dialecte, where tb_dialecte.id_dialecte = tb_data_iae.id_dialecte' on line 1
I don’t know how to debug this, since I try a lot of queries, but nobody works, and the error message is almost the same every time it is higher ...
thanks for the help!
source
share