Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有 3 个数组列,我试图获取每个数组的计数,但 node-postgres 只返回其中一个,即 SQL 语句中传递的最后一个 array_length()。我使用 postgres 控制台传递了相同的 sql 查询,它返回了所有结果。
好的,想通了,数组查询需要用括号括起来
(array_length(friends,1),array_length(clients, 1),array_length(venues, 1))
这将返回例如(3,3,7),否则只有最后一个查询将返回(7)。
(3,3,7)
(7)