简体   繁体   中英

How to sort by the result of multiple columns division with Sequelize.js?

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 ?

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

 order: [
   [
     {
       raw: 'col1 / col2 DESC',
     },
   ],
 ],

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM