Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Tell me what is the order in which the sql query is executed?

932


What is side by side migration in sql server?

1078


Is profiler the only tool that has the ability to audit and identify ddl events? : sql server security

1029


What do you do in data exploration

974


How to declare and use cursor variables?

1136


Difference between group by clause and having clause in SQL?

955


What is the stuff?

984


What is raid, and how it can influence database performance?

1043


How do I trace a query in sql server?

932


Does sql server 2016 have ssms?

939


What are the disadvantages of merge replication?

1387


Explain how you can configure a running aggregate in SSRS?

163


What is clustered primary key?

995


What are the two authentication modes in sql server?

1095


after migrating the dts packg to ssis by using migrtn wizrd in 2005. iam not able to open ssis pack and getting error. what r those errors? how to resolve?

2077