UPDATE
Changes the values of the specified columns based on the assign
argument (identifier=expression
) in all rows that satisfy the condition in the WHERE
clause.
UPDATE table_name SET assign [, assign ]* [ WHERE booleanExpression ]
Example
UPDATE UFOs SET shape='ovate' where shape='eggish';
Update Via Subquery
You can update a table via subquery, which allows you to update based on calculations performed on another table.
Examples
UPDATE test_facts SET lookup_id = (SELECT SAMPLE(test_lookup.id)
FROM test_lookup WHERE test_lookup.val = test_facts.val);
Cross-Database Queries
In Release 6.4 and higher, you can run UPDATE queries across tables in different databases on the same HEAVY.AI cluster without having to first connect to those databases.
To execute queries against another database, you must have ACCESS privilege on that database, as well as UPDATE privilege.
Example
Update a row in a table in the my_other_db
database:
UPDATE my_other_db.customers SET name = 'Joe' WHERE id = 10;
Last updated