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
Name some of the open source software that you can use in alternative to SSR?
What are difference between Cluster index and Non-Cluster index?
How optimize sql query with multiple joins in sql server?
What is a document index?
What is sqlcmd?
What is constraints and its types?
What is the maximum size of sql server database?
How do I open a .db file?
What is difference between createstatement and preparedstatement?
What is a mutating table error and how can you get around it?
What is 1nf normalization form?
What are the difference between primary keys and foreign keys?
What is the difference between ROW_NUMBER and Ranking function in SQL SERVER?
How to enable/disable indexes?
What is the latest version of microsoft sql server?