Skip to main content
Skip table of contents

Update Table

You are looking at an older version of the documentation. The latest version is found here.

Usage

You can update a table using aliases:

SQL
UPDATE <schema>.<table> [[AS] <alias>]
SET <alias>.<columnname> = value

Examples

1. For a table with columns A, B:

SQL
CREATE TABLE dwh.test_table (a integer, b integer) ;;
INSERT INTO dwh.test_table VALUES(1, 2);;
INSERT INTO dwh.test_table VALUES(3, 4);; 

2. Update without AS:

SQL
UPDATE dwh.test_table x SET x.a = 100 WHERE x.b = 2 ;;

3. Update with AS:

SQL
UPDATE dwh.test_table AS x SET x.a = 1000 WHERE x.b = 2 ;;

See Also

UPDATE statement with two tables for a workaround for referencing a second table in a JOIN clause

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.