wale
wale

性别: 注册于 2021-05-07

向TA求助
20金币数
1890 经验值
1个粉丝
主页被访问 2408 次

163 个回答

0 赞同

有关矩阵相乘的问题

矩阵相乘用dot(X,Y) 或 X**Y,详见 https://gitee.com/dolphindb/Tutorials_CN/blob/master/matrix.md#32-%E7%9F%A9%E9%98%B5%E7%9B%B8%E4%B9%98%E6%B1%82%E9%80%86%E8%BD%AC%E7%BD%AE%E6%B1%82%E7%9F%A9%E9%98%B5%E8%A1%8C%E5%88%97%E5%BC%8F *表示两个矩阵对应元素分别进行*计算,逻辑与下式等价: m1.flatten() *m3.f...

回答于 2021-09-20 10:14

0 赞同

在C++流数据订阅端的handler中如何得到某几个列并组成新表

可以用Util::createTable(const vector<string>& colNames, const vector<ConstantSP>& cols)建新表,如下例所示,取原表前30列组成新表,其中用t->getColumnName(i)得到原表列名,用t->getColumn(i)得到列向量: auto handler_1 = [&](Message msg) { vector<strin...

回答于 2021-09-14 18:30

0 赞同

如何按主键列求出2个表的交集

可以用ej函数实现,示例如下: t1=cj(table(2021.09.01..2021.09.30 as date),table(`a`b`c as ticker))t1[`close]=1..90 t1[`open]=1..90 t2=cj(table(2021.08.15..2021.09.13 as date),table(`d`b`c as ticker))t2[`ret_1d]=1..90 t2[`ret_2d]=1..90 t3=ej(t1,t2,`date`ticker)t01=select date,ticker,close,open from...

回答于 2021-09-10 14:24

0 赞同

symbol股票代码有没有什么简单的办法转成int

string调c_str 然后atoi强转,这个方法可以。

回答于 2021-09-09 16:49

0 赞同

有什么语句可以直接导出建表脚本吗

可以用下面自定义函数导出: /* @input dbName:数据库名称 * tableName:表名称 * @output 返回分区表建表信息 * @注意: * */ def getDDL(dbName,tableName){ //表不存在提示信息 if(!existsTable(dbName,tableName)){ return "Please check whether the table exists" } //字段与字...

回答于 2021-09-09 16:46

0 赞同

Failed to add new value partitions to database

修复方法如下: 第1步,用getClusterChunksStatus在控制节点上得到 `/dwd/domain'的chunkid,示例代码如下: select * from rpc(getControllerAlias(), getClusterChunksStatus) where  file like "%/domain%" and state != 'COMPLETE' 第2步,用getAllChunks得到该chunkid在数据节点的分区信息,下面代码中chunkid为...

回答于 2021-09-09 09:18

0 赞同

DolphinDB中如何选择数据表中某列不重复的元素?

可以用distinct函数,详见 https://www.dolphindb.cn/cn/help/FunctionsandCommands/FunctionReferences/d/distinct.html

回答于 2021-09-06 08:41

0 赞同

DolphinDB有类似MySQL的Exists的用法吗

可以用in以及嵌套查询,如: update t set amount=10 where 销售季名称="过季" and store_code in (exec store_code from (select count(新品预算) as cnt from t group by store_code) where cnt=0) 或者分步查询,如: code=select store_code from t group by store_code having count(新品预算)=0update t set amoun...

回答于 2021-09-04 21:47

0 赞同

c++ api中怎么取各列的值

用下列方法取值: table->getColumn(colIndex)->get(rowIndex)->getString()   详情可参阅 https://gitee.com/dolphindb/Tutorials_CN/blob/master/c++api.md 这个api读写指南

回答于 2021-09-04 21:39

0 赞同

question on the best way to do this

select askPrice1 *askQty1 , askPrice2*askQty2 ... askPrice50*askQty50 from table. This is already the optimal way.

回答于 2021-09-03 11:22