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 |
|
jung1975
Aged Yak Warrior
503 Posts |
Posted - 2005-08-16 : 15:18:08
|
I have a table looks likep_id HBL LBL risk1008 120 90 MND1008 111 90 NOD1009 129 85 MND1010 130 97 NOD I would like to count the total records, but if p_id is same then I would like to count only MND record( not NOD),so the total count should be 3 instead of 4 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
jung1975
Aged Yak Warrior
503 Posts |
Posted - 2005-08-16 : 15:58:39
|
| Actually, I want to count how many people are in MND and how many are in NODMND = 2 and NOD = 1 |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2005-08-16 : 16:38:53
|
| Read the Hint link in the sig so we can all be clear about what your req's areSELECT risk, COUNT(DISTINCT p_id) FROM myTable99 GROUP BY riskBrett8-)Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx |
 |
|
|
|
|
|