可以配合DolphinDB元编程实现:
https://www.dolphindb.cn/cn/help/200/FunctionsandCommands/FunctionReferences/s/sql.html
data = table(take(1 2, 10) as `id, 1..10 as `col1, 2..11 as `col2, 1..10 as `col3, 2..11 as `col4, 1..10 as `col5) def createAggMetaCode(aggDict){ metaCode = [] for(colName in aggDict.keys()){ for(funcName in aggDict[colName]) { metaCode.append!(sqlCol(colName, funcName, colName + `_ + funcName)) } } return metaCode } aggDict = { "col1" : [min, max, std], "col2" : [min, max, std], "col3" : [min, max, std], "col4" : [min, max, std], "col5" : [min, max, std] } createAggMetaCode(aggDict) sql(select = createAggMetaCode(aggDict), from = data, groupBy = <id>).eval()
分别对col1, col2, col3, col4, col5 调用min, max, std函数