如何在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
相关产品推荐
相关产品推荐

