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

How to disconnect from a sql server using mssql_close()?

1109


What is "scheduled jobs" or "scheduled tasks"?

979


What are the properties of sub-query?

1072


How to enable tcp/ip protocol on a sql server?

1161


What is for xml in sql server?

1073


Can binary strings be converted into numeric or float data types?

1033


In how many ways you can invoke ssrs reports?

139


Where sql server user names and passwords are stored in sql server? : sql server database administration

1052


how to create “alternate row colour”?

146


What are distributed partitioned views?

1073


What is difference between inner join and full join?

1065


Is it possible to update the views? If yes, how, if not, why?

1029


What is identity?

1013


Can we use pragma autonomous_transaction in trigger?

962


Explain different types of locks in sql server.

1077