TQL UPDATE Statement to set a column values from another table using joins
I want to update a table's column (revenue) from another table by applying joins/Condition on the client name
SET New_field = "table1".revenue
INNER JOIN table1.Client = table2.Client;
There is a way you might be able to mimic, but that would only work if the 'Client' field is the primary key in both tables. If that is the case you could make use of the concept that all inserts are upserts in ThoughtSpot, so you could do something like:
INSERT INTO table2 ( Client , Revenue , <other fields from table 2> ) SELECT table2.Client , table1.Revenue , <other fields from table 2> FROM table2, table1 WHERE table1.Client = table2.Client;
If this is on a production system, create a snapshot first!