1

以下是我的查询:

select t1.id,
sum(
((t1.json->'group_te3dx03/group_tb3th42'->>1)::t1.json->>'group_te3dx03/group_tb3th42/number_of_seats_allotted_to_wo')::int +
((t1.json->'group_te3dx03/group_tb3th42'->>1)::t1.json->>'group_te3dx03/group_tb3th42/number_of_seats_allotted_to_me')::int 
)as number_of_seats

FROM table1 as t1 , table2 as t2
WHERE t1.xform_id = t2.id;

在这里,我尝试对 Table1 使用具有别名的嵌套组。

在执行此查询时,我在 PostGres 中收到以下错误:

ERROR: schema "t1" does not exist
SQL state: 3F000

我觉得这个错误可能是由于别名't1'错误地用于Json中的嵌套组。

请帮我完成这个查询。

4

0 回答 0