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 / ramadass

select classname,count(*) from students group by
classname

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to check table values in sql server?

908


What is hierarchy, what are its types and difference between them? : sql server analysis services, ssas

1206


What is the difference between Triggers and Stored Procedure?

1030


Define Business Edition in SQL Azure?

100


What are the differences between stored procedure and view in sql server?

1158


Why de-normalization required?

940


What language is sql server written in?

984


difference between Clustered index and non clustered index ?

933


How to deploy the Report?

125


What are various limitations of the views?

996


List the advantages of using stored procedures?

996


What is open database communication (odbc)?

1003


How to get a list of columns using the "sp_help" stored procedure in ms sql server?

982


Do you know what are acid properties?

1018


what purpose does the model database serve? : Sql server database administration

920