| ??????? |
A |
| 1 |
=db.query("select * from 销售表 order by 产品,月份") |
| 2 |
=A1.select(if(产品==产品[-1],销量/销量[-1])>1.1) |
| ?????? |
A |
| 1 |
=db.query("select * from 销售表 order by 产品,月份") |
| 2 |
=A1.derive(if(产品==产品[-1]&&产品==产品[1],销量{-1:1}.avg()):移动平均) |
| ?????? |
A |
? |
| 1 |
=db.query("select * from 事件表 order by 序号") |
? |
| 2 |
=A1.select(时刻!=max(时刻{:0})||时刻!=min(时刻{0:})) |
和前后所有记录对比 |
| ??????? |
A |
| 1 |
=db.query("select * from 收支表 order by 月份") |
| 2 |
=A1.group@o(收入>支出).select(~.收入<~.支出 && ~.len()>=3).conj() |
| ?????? |
A |
| 1 |
=db.query("select * from 收支表 order by 月份") |
| 2 |
=A1.group@i(收入<收入[-1]).max(~.len()) |
| ? |
A |
? |
| 1 |
$select S,E from T order by S |
? |
| 2 |
=A1.select(E>max(E{:-1})) |
去除被包含的条目 |
| 3 |
=A2.run(max(S,E[-1]):S) |
去除重叠时间段 |
| 4 |
=A2.sum(interval@s(max(S,E[-1]),E)) |
计算总时长 |
| 5 |
=A2.run(if(S |
合并有重叠的时间段 |
| ????? |
A |
| 1 |
=db.query@i("select 价格 from T order by 价格") |
| 2 |
=A1([(A1.len()+1)\2,A1.len()\2+1]).avg() |
| ??????? |
A |
| 1 |
=db.query@i("select 时刻 from 事件表 order by 时刻") |
| 2 |
=A1.group((#-1)\2).sum(interval@s(~(1),~(2)) |
| ??????? |
A |
| 1 |
=db.query("select * from 股价表 order by 交易日") |
| 2 |
=A1.pselect@a(收盘价>100).select(~>1) |
| 3 |
=A2.new(A1(~).交易日:交易日,A1(~).收盘价-A1(~-1).收盘价:涨幅) |