数据仓库服务 GAUSSDB(DWS)-UPDATE:示例

时间:2024-09-12 17:05:17

示例

创建表reason_update:
1
2
3
4
5
6
CREATE TABLE reason_update
(
    TABLE_SK          INTEGER               ,
    TABLE_ID          VARCHAR(20)           ,
    TABLE_NA          VARCHAR(20)
)WITH(ORIENTATION=COLUMN, ENABLE_HSTORE=ON);
向表reason_update中插入数据:
1
INSERT INTO reason_update VALUES (1, 'S01', 'StudentA'),(2, 'T01', 'TeacherA'),(3, 'T02', 'TeacherB');
对表reason_update执行UPDATE操作:
1
UPDATE reason_update SET TABLE_NA = 'TeacherD' where TABLE_SK = 3;
support.huaweicloud.com/HyDevg-910-dws/dws_04_1032.html