Code:
myTable2
(id) o
(1) 2 
(2) 3 
(3) 2 
(4) 5 

myTabl3
(id) cate
(1) 1 
(2) 2 
(3) 1 
(4) 1
I have 2 tables like the above.
The code1 below which has JOIN produces the result2 below.
Code:
code1


SELECT myTable2.id, o
FROM myTable2
LEFT JOIN myTable3 ON myTable2.id=myTable3.id

WHERE
myTable3.cate=1

ORDER BY myTable2.id

result1
(1) 2
(3) 2
(4) 5
In order to use the JOIN in UPDATE, I made the following would-be code which actually causes a SQL syntax error.
Code:
would-be code
UPDATE myTable2.
LEFT JOIN myTable3 ON myTable2.id=myTable3.id

SET o = 1

WHERE
myTable3.cate=1

[b]target myTable2 data after updating [b]
(1) 1
(2) 3 
(3) 1
(4) 1
How can I make it work correclty without the SQL syntax error?