SELECT SUM(column_name)
FROM table_name
WHERE condition;
I think this is covered in the documentation of dataview. Have you looked at this examples? What have you tried already?
strangely enough, I could not find nothing
already tried :
list
sum( column_name)
where column_name
table without id
sum( column_name)
where column_name
in both case the result is identical as the command without the sum() function
The sum of a single line/value is the value of that line. In order for the sum()
to work you need to group together some values, using a GROUP BY
statement.
If you want to lump everything together you could use GROUP BY true
, or else you find some other criteria to group your values togeyher in suitable chunks.
Thank you for your response, this is what i tried :
no error but no sum
BTW the column_name are inline metadata (e.g. : column_name :: value) in notes
Oopsie, I forgot to mention that when grouping the columns are saved within the rows
array, so instead of sum(column_name)
, you need to do sum(rows.column_name)
thanks a lot,
Is there a way to have within the same query, the list and the total sum at the end ?
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.