sql update query for two connected tables UPDATE rooms set r.vacant=true 
FROM reservation s,rooms r 
WHERE r.room_no = s.room_no AND s.cus_id=1


I created above sql queryto update room status.I want to set vacant as true when customer_id =1.
But this code didn't work on mysql.
Whats wrong with this?
Try using an INNER JOIN statement:

UPDATE rooms r
INNER JOIN reservation s
ON s.room_no = r.room_no
SET r.vacant=true
WHERE s.cus_id=1