My code in TSQL is like this:
UPDATE A
SET A.SHARE = some_new_value
FROM DB.TABLE_A A
INNER JOIN DB.TABLE_B B ON A.col = B.col,
( SELECT C.col FROM DB.TABLE_C C) fcal
WHERE B.col = fcal.col and A.col = fcal.col AND A.col>0 and fcal.col>0
When I have to update table A using a single table in SPARK SQL, I can easily do that using:
MERGE INTO DB.TABLE_A A
USING DB.TABLE_B ON......
WHEN MATCHED THEN SET UPDATE A.col = some_new_value
But how do you do the same operation with multiple tables or subqueries like in my case? In the above examples, 'col' is just a placeholder for the actual column.