0

how to write CASE WHEN query with waterline Model.

SELECT  description,order_no,CASE WHEN STATUS=1 THEN 'True' ELSE
'False' END AS STATUS FROM CATEGORY_MAS as category
rdonuk
  • 3,921
  • 21
  • 39
Pranay Soni
  • 1,056
  • 10
  • 18
  • ModelName.query(QueryString,function(err,results){}); i guess this is what you need – vkstack Mar 26 '16 at 21:33
  • i know query method but i need readable solution. row sql query is not readable. – Pranay Soni Mar 26 '16 at 23:44
  • There is no way in waterline since it is impractical to cover all the possible query.But you can try it manually that will be readable for sure. – vkstack Mar 27 '16 at 12:28

1 Answers1

0

as par as I know there is no such facilities provided by waterline js in sails js. It is better to fetch data and use if else in your sails controller.

md asif rahman
  • 389
  • 3
  • 9