【发布时间】:2019-12-22 12:48:47
【问题描述】:
所以我试图卷积多个查询并将结果形成为
[
{
heading: 'Test',
subheading: 'SubTest',
pItems: [
{
pid: 1,
product_name: 'Random Product',
stock: 500
},
{
pid: 1,
product_name: 'Random Product',
stock: 500
}
]
},
{
heading: 'Test 2',
subheading: 'SubTest 2',
pItems: [
{
pid: 1,
product_name: 'Random Product 2',
stock: 500
},
{
pid: 1,
product_name: 'Random Product 2',
stock: 500
}
]
}
]
这是我尝试过的
https://dbfiddle.uk/?rdbms=postgres_10&fiddle=af81919b853b571ca2f25c96abbad596
但是我收到了这个错误
错误:聚合函数调用不能嵌套
【问题讨论】:
标签: node.js postgresql aggregate-functions psql pg