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
What is isolation levels?
What number sorts of privileges are accessible in sql?
What is the use of set nocount on/off statement?
Explain the concepts and capabilities of sql server?
What is the difference between Normalization and De-normalization?
How to scale out a federation by Sql statement?
List out the differences between global and local temp tables in sql server?
What are the benefits and tasks of object explorer? : sql server management studio
How to view existing indexes on an given table using sp_help?
When we should use @@error?
What is impersonation? What are the different impersonation options available in ssas? : sql server analysis services, ssas
Can we perform backup restore operation on tempdb? : sql server database administration
What are sub reports?
What is difference between clustered and non clustered index?
What are the types of database recovery models?