i have table students with fields classname,studname
select * from students
classname studname
1 xxxxx
1 yyyy
1 zzzz
2 qqqq
2 tttt
3 dsds
3 www
i want the output should be
No of students in class 1 : 3
No of students in class 2 : 2
No of students in class 3 : 2
Answer Posted / ramadass
select classname,count(*) from students group by
classname
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Is INSTEAD OF trigger directly applicable to Table ?
What is it unwise to create wide clustered index keys?
What are the components of dbms?
You want to generate a report that is formatted as a chart. Can you use the report wizard to create such a report?
Which Model uses the SET concept
How to implement one-to-one, one-to-many and many-to-many relationships while designing tables?
You have to store user responses of ‘yes’ and ‘no’ what kind of data type is best suited for this task?
Explain cross join or cartesian product in sql?
What is the importance of a recovery model?
How do I port a number to sql server?
what is a major difference between sql server 6.5 and 7.0 platform wise? : Sql server database administration
How does stuff differ from the replace function?
What is RAID? What are the different types of RAID configurations?
Why we use functions in sql server?
What is a trace frag?