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 sql*loader?

1195


what is sub-query? : Transact sql

1108


What is bind reference and how can it be created?

1021


What does varchar include?

953


What is database white box testing and black box testing?

1112


What is a primary key called that is made up of more than one field?

1352


what is unique key constraint? : Sql dba

1042


Is sql a programming?

978


What is sql and explain its components?

1071


What do you mean by field in sql?

1080


What is a left inner join?

1019


Write a query to find the names of users that begin with "um" in sql?

999


what is a composite key ? : Sql dba

1066


How do I run pl sql in sql developer?

1120


Explain the rollback statement?

1014