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 number aggregate functions are accessible there in sql?
What is a View ? Can we insert, Update and delete a view?
What is filestream?
What is the purpose of sql profiler in sql server?
What is the process of normalization?
Can a table have 2 foreign keys?
Does group by or order by come first?
Please explain the characteristics of a transaction server for example atomicity, consistency, isolation, durability?
Where cross join is used?
Can you type more than one query in the query editor screen at the same time?
Explain the database you used in your final year project?
What is the meaning of lock escalation and why/how to stop this? : sql server database administration
Does a full backup include transaction log?
How to turn on the mssql api module in php?
What are built in functions?