首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >当表中有350行时,Array_accum返回postgres中的空值

当表中有350行时,Array_accum返回postgres中的空值
EN

Stack Overflow用户
提问于 2016-03-22 06:01:57
回答 1查看 225关注 0票数 0

我使用以下查询

代码语言:javascript
复制
select distinct throttle_id, array_accum(param) over (partition by throttle_id) as script_exclude from throttle_data where exclude = 't' and valve_type = 513 and throttle_id = 1270571881

我在script_exclude字段中得到了空值

我在param列中的示例值是,

机票/定价/发射_0tc.wql机票/定价/发射_0xp.wql机票/定价/发射_0xp_down.wql.0xp机票/定价/发射_0xp_up.wql

No.of行是351

请给我建议,我怎么能得到这些所有的价值。

你好,Sachin Jain

EN

回答 1

Stack Overflow用户

发布于 2016-03-28 11:24:02

相反,请尝试以下几点:

代码语言:javascript
复制
select throttle_id, array_agg(param) as script_exclude 
  from throttle_data where exclude = 't' 
       and valve_type = 513 and throttle_id = 1270571881
group by throttle_id;

如果仍然返回null,则尝试:

代码语言:javascript
复制
select * from throttle_data
 WHERE exclude = 't'
       and valve_type = 513 and throttle_id = 1270571881;

看看什么是聚合的。

如果不返回任何行,那么where子句中的条件就有问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36147213

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档