-1

This is my query

UPDATE ludo_purchase_detailed_history 
SET fto_date = logs_20221002.fto_date 
FROM logs_20221002 
WHERE ludo_purchase_detailed_history.uid= logs_20221002.uid;

This is the error I am getting

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 logs_20221002 WHERE ludo_purchase_detailed_history.uid= logs_20221002.uid' at line 1

Please help me. If anyone know what I am doing wrong here.

3
  • 3
    In MySQL there is no FROM clause in UPDATE syntax. Read the Reference Manual, "Multiple-table UPDATE syntax" carefully. Commented Oct 6, 2022 at 6:32
  • you require an update with a join!! Commented Oct 6, 2022 at 6:39
  • @nikhilsugandh I take refrence from this stackoverflow.com/questions/224732/… I want to update a table column using another table Commented Oct 6, 2022 at 6:42

1 Answer 1

1

MySQL has a different syntax than MSSQL

UPDATE ludo_purchase_detailed_history h
JOIN logs_20221002 l ON h.uid = l.uid
SET h.fto_date = l.fto_date 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.