Solved

Calculate percentage (2)

Posted on 2009-06-29
2
176 Views
Last Modified: 2012-05-07
See earlier post.

When I test the code I get following result:
50,100,75,25
but I should get: 20,40,30,10
How can I fix this?
0
Comment
Question by:johnkainn
2 Comments
 
LVL 37

Accepted Solution

by:
momi_sabag earned 500 total points
ID: 24734746
sorry
i had a mistake
try this

select distinct id, 100*sum(units) over(partition by id) / sum(units) over() as Unitspercentage
from myTable
0
 
LVL 14

Expert Comment

by:Jagdish Devaku
ID: 24734822
can u give the link of your previous post...???
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now