1

Here I want to sort by the result of multiple columns division, like:

ORDER BY col1 / col2 DESC

Or,

ORDER BY col2 / col3 / col4 ASC.

Is there some way to sort like this using sequelize.js ?

weichao.x
  • 315
  • 1
  • 13

1 Answers1

3

For lastest Sequelize.js, I find out this way to solve the question:

 order: [
   [
     {
       raw: 'col1 / col2 DESC',
     },
   ],
 ],
weichao.x
  • 315
  • 1
  • 13