• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 319
  • Last Modified:

Sql to show total

Hi,

i have 2 tables

Table one called T which has the following coloums
FCode, FName, N.

Table two called C which has the following coloums:
CC, ConC, Percentage
I        N          30
I        D           40
I        DU        30

for each CC the sum of all percentage should be 100

What I need to do is the following

Sql Statement

to CC where the sum of percentage is not 100, also to show how further off 100 the total of the percentage is.

Please help

Thanks,

R8VI
0
R8VI
Asked:
R8VI
1 Solution
 
malikirfan28Commented:
Hello,
Kindly use the following query.

select CC, sum(Percentage), 100 - sum(Percentage) as 'TotalOff'
from C
group by CC
having sum(percentage) != 100
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now