改表table的前3个记录和后3个记录,dolphindb语句应该怎么写

请先 登录 后评论

1 个回答

mhxiang

可以用update 和rowNo函数

t2 = table(take(`A,10) join take(`B,10) as sym, take(09:56:00+1..10,20) as time, (10+(1..10)\10-0.05) join (20+(1..10)\10-0.05) as bid, (10+(1..10)\10+0.05) join (20+(1..10)\10+0.05) as offer, take(100 300 800 200 600, 20) as volume);
update t2 set bid=bid*( rowNo(bid)>=3) +5*(rowNo(bid)<=3) context by sym
update t2 set bid=bid*( rowNo(bid)<size(bid)-3) +5*(rowNo(bid)>=size(bid)-3) context by sym
请先 登录 后评论
  • 1 关注
  • 0 收藏,882 浏览
  • haaha 提出于 2022-04-11 15:41

相似问题