1

For a table with around 100 columns, how can I quickly calculate the sum of all columns for each row in DolphinDB? Looks like all DolphinDB functions for a table apply to columns, not rows.

Steven
  • 39
  • 5

2 Answers2

1

DolphinDB's aggregate functions indeed apply to columns. Unfortunately, you'll have to write out this summation yourself (or write some code that generates it):

SELECT col1 + col2 + col3 + /* etc... */ AS sum_of_cols
FROM   mytable
Mureinik
  • 297,002
  • 52
  • 306
  • 350
0

DolphinDB provides a built-in function named rowSum that exactly does what you want.

t = table(...)
rowSum(t)

You can find the official documentation here.

3dori
  • 11
  • 6