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 / debasish
select classname,count(studentname) from students group by
classname
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
Tell me what is the order in which the sql query is executed?
What is side by side migration in sql server?
Is profiler the only tool that has the ability to audit and identify ddl events? : sql server security
What do you do in data exploration
How to declare and use cursor variables?
Difference between group by clause and having clause in SQL?
What is the stuff?
What is raid, and how it can influence database performance?
How do I trace a query in sql server?
Does sql server 2016 have ssms?
What are the disadvantages of merge replication?
Explain how you can configure a running aggregate in SSRS?
What is clustered primary key?
What are the two authentication modes in sql server?
after migrating the dts packg to ssis by using migrtn wizrd in 2005. iam not able to open ssis pack and getting error. what r those errors? how to resolve?