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...


Table name: T1, it has only one column.

col1
------
c
b
a
b
b
b
b
d
s
a
a
t
s


Requirement:

I need the following output from the above base table by
using SQL query.


col1 Cnt
----- -------
a 3
b 5
Others 5


Please help.

Thanks
Guru
v.gurus@in.com








Answer Posted / sandhya

SELECT col1, count(*) cnt
FROM T1
GROUP BY col1
ODER BY col1

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is identity column in sql server?

1046


How do you take the union of two tables in sql?

982


What is the source code of a program?

1069


What is a delimiter in sas?

1052


what is the functionality of the function htmlentities? : Sql dba

951


what is the use of double ampersand (&&) in sql queries?

1174


What is trigger and how to use it in sql?

1021


Is pl sql better than sql?

1026


What is right join in sql?

1087


What is difference between rank () row_number () and dense_rank () in sql?

1100


How many types of triggers are there in pl sql?

1066


What is cursor in pl sql?

1114


In pl/sql, what is bulk binding, and when/how would it help performance?

993


How do you rename a table in sql?

1103


How do I know if I have sql express or standard?

1029