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
Give an example of why you would want to denormalize a database
How to execute a sql statement using odbc_exec()?
What is table value parameters (tvp)?
What is user-defined inline table-valued function?
How to make a remote connection in a database?
What are the instances when triggers are appropriate?
What is a ddl statement?
what is normalization? : Sql server database administration
How to update a field in SQL after ALTERING a row?
What is Dependency Injection and provide example?
Tell me what are the advantages of using stored procedures?
Explain the architecture of ms sql reporting service?
How to filter records of table in SQL SERVER?
What are the properties of sub-query?
What is ms sql server index?