How to do this in the future?
SELECT ProductID, Name, ListPrice, ListPrice * 1.15 AS NewPrice
FROM Production
I tried:
db.Production.findAndCountAll(
attributes: {
include: [
['ListPrice * 1.15', 'NewPrice']
]
}
).then(function(orders){
return res.jsonp(output);
})
But that will not work.
This is the request I expect:
SELECT Production.ProductID, Production.Name, Production.ListPrice, Production.ListPrice * 1.15 AS NewPrice
FROM Production
Instead, I see this query:
SELECT Production.ProductID, Production.Name, Production.ListPrice, ListPrice * 1.15 AS NewPrice
FROM Production
source
share