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
 Transact-SQL (2000)
 Grouping

Author  Topic 

rintus
Starting Member

26 Posts

Posted - 2008-09-18 : 10:44:22
Suppose I have 100 students and I want to count the number subjects that each student takes from 250 available. How do I identify it? please suggest

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-18 : 11:21:49
something like:-
SELECT StudentID,COUNT(SubjectID) AS SubCount
FROM YourTable
GROUP BY StudentID
Go to Top of Page

rintus
Starting Member

26 Posts

Posted - 2008-09-18 : 11:42:47
It works.......Many thanks...
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-18 : 11:54:36
quote:
Originally posted by rintus

It works.......Many thanks...


welcome
Go to Top of Page
   

- Advertisement -