Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-09-24 : 08:41:29
|
| Rose writes "Hi...i want to count percent from this data:I have one column name 'Kehadiran', so how can i count a percent, because i need to count total of that column and i need to count how many 'Y' in that same column.please help me..thanks." |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2004-09-24 : 08:52:06
|
| hard to have any idea specifically what you are looking for, but in general:select ID, 1.0 * Value / (Select SUM(Value) from tbl) as Pctfrom tblwill return each ID in a table, along with a value, and what that value is as a percentage as the total from the tbl.- Jeff |
 |
|
|
|
|
|