I have a main table and an index table. Both tables share a common primary field called “L_Status”. I want to update the data in the main table from “L_Status” values (integers) into “L_StatusLV” (readable text values) based on the reference in the index table called “status”. Here is the code I’ve entered into PHPmyAdmin to accomplish this:
UPDATE markers.L_Status
FROM markers
INNER JOIN STATUS ON markers.L_Status = status.L_Status
WHERE markers.L_Status = status.L_StatusLV
PHPmyAdmin returns the following error:
1064 – 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 markers INNER JOIN STATUS ON markers.L_Status = status.L_Status WHERE ma’ at line 2
Any advice on the sytax error here?
MySQL’s
UPDATEJOINsyntax differs from SQL Server’s (which looks like what you have):However, as you noted above the current values are integers. If the column
markers.L_Statusis anINTcolumn rather than aCHAR/VARCHARas I assume the human-readable column is, this won’t work.Visit MySQL’s
UPDATEsyntax reference for the full syntactic details. In particular, thetable_references.