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

What is snapshot report?

172


What are the different methods available under sqlcommand class to access the data?

1166


what is the main function of a query parameter?

155


Where cross join is used?

1026


Can you please differentiate between a primary key and a unique key?

1048


What is multi-statement table-value user-defined function?

1051


Why do we need different type of parameter?

1106


What is a with(nolock)?

1024


Why do we use stored procedures in sql server?

997


Does any body please help me what question's have asked for SSRS in the interview?

2201


Once setting replication, can you have distributor on sql server 2005, publisher of sql server 2008?

1006


Explain forward - only cursors?

1128


What is lock escalation and what is its purpose?

1024


How to sort the query output with order by clauses in ms sql server?

1068


What are the benefits of filtered indexes?

1095