cómo obtener la suma de una columna en secuencia
const totalAmount = await DONATIONS.findAll({
attributes: [
'member_id',
[sequelize.fn('sum', sequelize.col('amount')), 'total_amount'],
],
group: ['member_id'],
raw: true
});
Run code snippet
Anies