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
How to check table values in sql server?
What is hierarchy, what are its types and difference between them? : sql server analysis services, ssas
What is the difference between Triggers and Stored Procedure?
Define Business Edition in SQL Azure?
What are the differences between stored procedure and view in sql server?
Why de-normalization required?
What language is sql server written in?
difference between Clustered index and non clustered index ?
How to deploy the Report?
What are various limitations of the views?
List the advantages of using stored procedures?
What is open database communication (odbc)?
How to get a list of columns using the "sp_help" stored procedure in ms sql server?
Do you know what are acid properties?
what purpose does the model database serve? : Sql server database administration