|
-
Jun 20th, 2003, 04:20 AM
#1
Thread Starter
Junior Member
display issues for computation.
I have a record set which diplays the results something like this.
columnA columnB
9 blah
1 blahblah
0 dsjf
1 blah
2 blah.
I am trying to compute this table and populate in my new table as
newcolumn - A newcolumn - counts newcolumn - percent
0 1
1 2
2 1
9 1
Total
-
Jun 20th, 2003, 04:22 AM
#2
Thread Starter
Junior Member
I am sorry the post was not complete
newcolumn - A newcolumn - counts newcolumn - percent
0 1
1 2
2 1
9 1
Total will be 5 and the percentile column will be for 0 as 1/5 * 100 like this.
Help plz..
-
Jun 20th, 2003, 05:07 AM
#3
Hyperactive Member
I am not sure if I understand exactly what you want try this :
Code:
SELECT colA,COUNT(colA) as number,perc=(CAST((COUNT(colA)*100) as float)/(SELECT COUNT(id) FROM tableA))
FROM tableA
GROUP BY colA
This will give you :
colA,number,perc
0, 1, 20.0
1, 2, 40.0
2, 1, 20.0
9, 1, 20.0
Is this what you want?
--
Anglo Saxon
-
Jun 20th, 2003, 05:11 AM
#4
Thread Starter
Junior Member
I think this should work. Let me try this query - will get back in 10 mins.
Thanks a lot..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|