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
What is a view in sql?
What does it mean if @@cursor_row returns a negative number?
What is built-in function?
What are views used for?
Explain what are the events recorded in a transaction log?
How do I view a stored procedure in sql server?
How to concatenate two character strings together?
What are the 10 characteristics of data quality?
How to create hyperlink from returned sql query ?
Can we write a distributed query and get some data which is located on other server and oracle database?
Explain error handling in ssis?
What are the types of resultset?
List down some advantages of sql stored procedure?
What are the different types of replication are there in sql server 2000?
What is transaction server consistency?