使用select-in和多个输出列更新表

ogq8wdun  于 2021-07-26  发布在  Java
关注(0)|答案(1)|浏览(300)

查询错误:输入的子查询只能有一个输出列。如何更新此表?谢谢您

UPDATE table
       SET ViewItem = SessionStart
       WHERE  (event_date, user_pseudo_id) 
       IN 
       (SELECT event_date, user_pseudo_id
        FROM table
        WHERE ViewItem > SessionStart
        GROUP BY event_date, user_pseudo_id
        ORDER BY event_date, user_pseudo_id
       )
;
rnmwe5a2

rnmwe5a21#

试试下面

UPDATE table
       SET ViewItem = SessionStart
       WHERE  (event_date, user_pseudo_id) 
       IN 
       (SELECT AS STRUCT event_date, user_pseudo_id
        FROM table
        WHERE ViewItem > SessionStart
        GROUP BY event_date, user_pseudo_id
        ORDER BY event_date, user_pseudo_id
       )
;

相关问题