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
How to enable/disable indexes?
What are the approximate numeric data types?
What are different types of data sources?
What are entities and relationships?
Which is better statement or preparedstatement?
how to take backup bcp out for a column in table in sql server?
what's the information that can be stored inside a bit column? : Sql server database administration
can we have a nested transaction? : Sql server database administration
How to round a numeric value to a specific precision?
Explain important index characteristics?
How to list all login names on the ms sql server?
After creating the cube, if we added a new column to the oltp table then how you add this new attribute to the cube? : sql server analysis services, ssas
How to connect to a sql server using odbc_connect()?
How many types of relations are there between dimension and measure group? : sql server analysis services, ssas
What is intellisense?