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
What the different types of Replication and why are they used?
What is page in sql server?
How will you hide an attribute? : sql server analysis services, ssas
What are ddl triggers and types of ddl trigger?
How to write a query with a full outer join in ms sql server?
What is the template in sql?
Is BCNF better than 2NF & 3NF? Why?
What is recompile sql server?
What is 1nf normalization form?
Is mysql the same as sql server?
Why use triggers?
Why we need sql server?
explain the difference between oracle- sql and sql server sql ? if both are same y we r using 2 sw.s?
can an order by clause be used in a creation of a view?
What is the default order of an order by clause?