I have a MySQL query that looks like this:
SELECT (SUM(total_time * actual_fte) / SUM(total_time)) AS actual_fte FROM USERS GROUP BY HOUR(timestamp)
I'm assuming it's some type of variant of this type of function:
attributes: [[models.sequelize.fn('SUM',models.sequelize.col('total_time')),'total_time']]
So, how would I turn this MySQL query into the sequelize version?
Use Sequelize.literal... It will be ok and you can do anything what you want ;)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With