0

I am trying to update the columns based on other table data but receiving the below error

Trying to execute in Databricks

Error in SQL statement: ParseException: 
mismatched input 'FROM' expecting {<EOF>, ';'}(line 8, pos 0)

== SQL ==
UPDATE
    rd
SET
    rd.transaction_date = olc.transaction_date,
    rd.store_number =     olc.store_number,
    rd.terminal_number =  olc.terminal_id,
    rd.sequence_number =  olc.transaction_number
FROM delta.`/reservation_detail_olc` rd
^^^
UPDATE
    rd
SET
    rd.transaction_date = olc.transaction_date,
    rd.store_number =     olc.store_number,
    rd.terminal_number =  olc.terminal_id,
    rd.sequence_number =  olc.transaction_number
FROM delta.`reservation_detai` rd
    inner JOIN
    delta.`order_line` olc
ON rd1.confirmation_number =olc.res_confirmation_number
WHERE rd.confirmation_number =olc.res_confirmation_number
Charlieface
  • 52,284
  • 6
  • 19
  • 43
  • I don't know that Databricks supports SQL Server's proprietary update from syntax. [The documentation](https://docs.databricks.com/sql/language-manual/delta-update.html) (always a good first bet to check) certainly doesn't make it seem likely, so I think you'll have to accomplish your update in another way. (Also your second example has an `rd1` that can't possibly be valid.) – Aaron Bertrand Apr 03 '22 at 18:11

1 Answers1

0

The syntax used in Databricks SQL guide for update command does not have FROM clauses. They do not support it.

Goosefand
  • 205
  • 1
  • 2
  • 7