sequlize $eq two columns code example
Example 1: sequelize.fn
// Counting number of totalPrice from column itemPrice table
Model.findAll({
attributes: {
include: [
[sequelize.fn('COUNT', sequelize.col('itemPrice')), 'totalPrice']
]
}
});
Example 2: sequelize.fn
// for gettting all username in uppercase
instance.update({
username: sequelize.fn('upper', sequelize.col('username'))
});
Example 3: SEQUELIZE OR
"SELECT * FROM Student WHERE LastName='Doe' OR FirstName in ("John","Jane") OR Age>18"