hive使用select from another table更新表列

luaexgnf  于 2021-06-02  发布在  Hadoop
关注(0)|答案(1)|浏览(442)

所有,这是可能的Hive,如果是这样,这是最理想的方式?谢谢!

UPDATE t1
    SET
    Y = SQRT(Y_w)*(Y-(SELECT v FROM t2 WHERE ID=1)),
    X1 = SQRT(Y_w)*(X1-(SELECT v1 FROM t2 WHERE ID=1)),
    X2 = SQRT(Y_w)*(X2-(SELECT v2 FROM t2 WHERE ID=1)),
    X3 = SQRT(Y_w)*(X3-(SELECT v3 FROM t2 WHERE ID=1)),
    X4 = SQRT(Y_w)*(X4-(SELECT v4 FROM t2 WHERE ID=1)),
    X5 = SQRT(Y_w)*(X5-(SELECT v5 FROM t2 WHERE ID=1)),
    X6 = SQRT(Y_w)*(X6-(SELECT v6 FROM t2 WHERE ID=1)),
    X7 = SQRT(Y_w)*(X7-(SELECT v7 FROM t2 WHERE ID=1)),
    X8 = SQRT(Y_w)*(X8-(SELECT v8 FROM t2 WHERE ID=1));
isr3a4wc

isr3a4wc1#

请验证您的查询。只有t1有w列,t2有id列时,它才会工作。

相关问题