Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

sequelize.fn

// Counting number of totalPrice from column itemPrice table 
Model.findAll({
  attributes: {
    include: [
      [sequelize.fn('COUNT', sequelize.col('itemPrice')), 'totalPrice']
    ]
  }
});
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
6+7 =