如何在DolphinDB数据库中一次向表中添加许多列

问题描述 投票:1回答:1

是否可以像这样一次添加许多列?

t=table(1..6 as id,(today()-5)..today() as tm);
update t set feature_1001..feature1030=float(),feature_2001..feature2020=float()

我写了以下方法,可以实现,但是感觉有点复杂。有没有更简单的方法?

for(x in 1001 .. 1030) t["feature_"+x] = float()
for(x in 2001 .. 2030) t["feature_"+x] = float()
sql database dolphindb
1个回答
0
投票
t["feature" + string(1001 .. 1030 join 2001 .. 2030)] = loop(x->float(), 1..60)
© www.soinside.com 2019 - 2024. All rights reserved.