Cannot SELECT from UPDATE RETURNING clause in postgres

前端 未结 7 1041
旧时难觅i
旧时难觅i 2020-12-03 10:36

I isolatet the problem from a much more complex query. Here the test scenario

DROP TABLE test; 
CREATE TABLE test (
  id integer,
  description varchar(100)
         


        
相关标签:
7条回答
  • 2020-12-03 11:42

    I'm addition from Ants Aasma, if select on same table, using:

    WITH updated AS (UPDATE test SET description = 'test' RETURNING id, description)
    SELECT * FROM updated;
    
    0 讨论(0)
提交回复
热议问题