sql - How to calculate query result on the bases of percentage -
i want calculate query result on bases of percentage, set admin panel of website. there 4 status same. gold, silver,bronze , medellin. current formula
select * , isnull( case when rownumber <= (@totaltoppromoters*@gold/100) 1 when rownumber >= (@totaltoppromoters*@gold/100) , rownumber <= (@totaltoppromoters*@gold/100) + (@totaltoppromoters*@silver/100) 2 when rownumber>=(@totaltoppromoters*@silver/100) , rownumber<= (@totaltoppromoters*@gold/100)+(@totaltoppromoters*@silver/100) + (@totaltoppromoters*@bronze/100)then 3 when rownumber>=(@totaltoppromoters*@medallion/100) , rownumber <= (@totaltoppromoters*@gold/100)+(@totaltoppromoters*@silver/100) + (@totaltoppromoters*@bronze/100)+(@totaltoppromoters*@medallion/100) 4 end ,0) trophytype
can guide me on this?
Comments
Post a Comment