How to update/merge rows except few columns in big query

Viewed 252

I have a use case where I need to update a bigquery table with 40 columns. I need to update all(38) columns except 2. How I can exclude those 2 columns in the update? Currently I'm setting all 38 columns explicitly.

    MERGE targetTable T
    USING stageTable S
    ON T.c1 = S.c1 AND
    T.c2 = S.c2
    WHEN MATCHED THEN
    UPDATE SET T.c3 = S.c3,T.c4 = S.c4,........
    WHEN NOT MATCHED THEN
    INSERT ROW 
0 Answers
Related