You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Kdb中使用带多参数函数的fby进行select查询?

在Kdb中用fby子句调用多参数函数的单步查询实现

想要在Kdb的select语句中直接通过fby子句调用接受多个参数的函数,完成单步筛选查询,无需先更新表再筛选的分步操作。

期望的写法(目标实现形式)

t:([] price:1000?1f; sym:`AAPL; qty:3.0; open:0.20);
select from t where open<({exec x wavg y};qty;price) fby sym

需避免的分步实现写法

t:update avgPrice:qty wavg price by sym from t;
t:select from t where avgPrice>open;

已找到的无需使用flip的可行写法

select from t where open<({[x] exec qty wavg price from x};([]qty;price)) fby sym

内容的提问来源于stack exchange,提问作者michel

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.24 04:17:07