Use total in table

ghoni

New member
Local time
Today, 15:59
Joined
May 5, 2018
Messages
1
I have a table
1 12 20 0.16
2 10 30 0.24
3 5 25 0.2
4 7 35 0.28
5 13 15 0.12
Total 125


first column item
second column price
third column expenses
forth column is the percent of the expenses to be calculated

I need to get the results 0.16,0.24,........

As ex in the first row 20/125=0.16
30/125=0.24

i need to use the total of column to be divided in another column to get the percent of this item from the expense
 
Select Item, Price, Expense, (Expense/(Select Sum(Expense) From Table)) As Percent From Table
 

Users who are viewing this thread

Back
Top Bottom