tencent cloud

Feedback

Last updated: 2024-08-07 17:26:27

    Description

    Supported engine: SparkSQL
    Applicable table: Native Iceberg tables
    Purpose: Update specified row in data table.

    Statement

    UPDATE tablePrimary
    SET assign [, assign ]*
    [ WHERE booleanExpression ]

    Parameter

    tablePrimary: Table name in the three-part format. Example: catalog.database.table.
    assign: Expression for row update. Example: col1 = 'new_data'.
    booleanExpression: Boolean expression

    Example

    UPDATE prod.db.table
    SET c1 = 'update_c1', c2 = 'update_c2'
    WHERE ts >= '2020-05-01 00:00:00' and ts < '2020-06-01 00:00:00'
    
    UPDATE prod.db.all_events
    SET session_time = 0, ignored = true
    WHERE session_time < (SELECT min(session_time) FROM prod.db.good_events)
    
    UPDATE prod.db.orders AS t1
    SET order_status = 'returned'
    WHERE EXISTS (SELECT oid FROM prod.db.returned_orders WHERE t1.oid = oid)
    
    
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support