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 |
dr223
Constraint Violating Yak Guru
444 Posts |
Posted - 2013-03-27 : 06:28:49
|
HI, I have a table called dbo.table1 which has 2 columns PracID PatientCode 3 Lung3 Lung 3 RetPro 11 RetPro 49 Lung49 RetPro49 Flu49 Flu49 FluI want the results to be PracID PatientCode Count3 Lung 23 RetPro 111 RetPro 149 Lung 149 RetPro 149 Flu 3Thank you |
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2013-03-27 : 06:29:53
|
so add a count and a group by to the query. |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2013-03-27 : 06:30:36
|
selectfield1,field2,count(*)from tablegroup byfield1,field2 |
|
|
|
|
|