arlet-db
Version:
A simple database manager for Node.js
19 lines (17 loc) • 521 B
Markdown
[🏠 Inicio](../README.md)
## sum Method
The sum method returns the sum of the values in a specified column of a specified table.
### Syntax
````javascript
async sum(tableName, column)
````
### Parameters
* tableName (String): The name of the table to sum values from.
* column (String): The name of the column to sum values from.
### Returns
* The sum of the values in the specified column.
### Example
````javascript
const totalSum = await db.sum('tableName', 'column');
console.log(totalSum);
````