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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 counting rows of particular category

Author  Topic 

asifbhura
Posting Yak Master

165 Posts

Posted - 2006-06-29 : 08:51:17
I have one table

it contains a lot of rows with different different category id

i want to count rows for each category.

exapmple

for education category it contains 20 rows.

for health catgory it contains 12 rows.

and so on.

i want query which count rows for each category

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-06-29 : 08:53:20
Read about Cross-tab Reports in sql server help file

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-06-29 : 08:58:27
[code]
SELECT CategoryID,
COUNT(*)
FROM OneTable
GROUP BY CategoryID[/code]
Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -