开发者

To get a average % of two columns

I have the columns as mentioned below

1)OldOrderQty
2)NewOrderQty
3)OLdunitRate
4)NewUnitRate

My issue is i need to get % of savings if there is any savings for the new unit rate

Please help me out with this thanks a lo开发者_StackOverflowt for any answers


Your question and terms aren't well defined, but this is what I'd lean towards:

SELECT 100*(1-NewUnitRate/OLdunitRate) AS percent_savings
FROM table

So, for example, if your OLdunitRate was 10, and your NewUnitRate was 7.5, your percent savings would be 25%.


3 * 1 = x
4 * 2 = y

y / x = would be the savings I presume

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜