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 implement service broker?

980


Can a rule be bound to any column of any data type?

944


How to rename an existing table with the "sp_rename" stored procedure in ms sql server?

1009


How do I open a .db file?

1020


Why does a sql statement work correctly outside of a user-defined function, but incorrectly inside it?

862


What is difference between getdate and sysdatetime in sql server 2008?

1040


Can we add a cpu to sql server?

988


What is the difference between Triggers and Stored Procedure?

1078


explain what is raid and what are different types of raid configurations? : Sql server database administration

988


If you want to send some data from access database to sql server database. What are different component of ssis will you use?

959


How to generate create function script on an existing function?

1089


Write a Select Query to display title for each group of records, which are collected with Compute Clause? Like titlefield column-A column-B ..... ..... ..... Sum ... titlefield column-A column-B ..... ..... ..... Sum ...

2018


How to list all triggers in the database with sys.triggers in ms sql server?

1055


what stored procedure can you use to display the current processes? : Sql server administration

993


What are truncate options available in sql server? : sql server database administration

1003