Model
const Productions=sequelize.define("Productions",{
rpt_date:{
type:DataTypes.DATE,
},
unit:{
type:DataTypes.STRING,
allowNull:false
},
commodity:{
type:DataTypes.STRING,
allowNull:false
},
quantity:{
type:DataTypes.INTEGER,
},
})
return Productions;
}
Inside unit field there are 8 values like
'KRB','MBR','GUA','MPR','BOL','BAR','TAL','KAL'.
I want to get sum of amount for any specific day by grouping the unit field for 'KRB', 'MBR', 'GUA', 'MPR' AS JGOM and 'BOL', 'BAR', 'TAL', 'KAL' AS OGOM