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 data type in database?

927


what is self-join? : Sql dba

1049


What is ttitle and btitle?

1006


What are the limitations of sql express?

982


What is difference between cursor and trigger?

1015


How to add a column ‘salary’ to a table employee_details?

953


what are the differences between get and post methods in form submitting. Give the case where we can use get and we can use post methods? : Sql dba

1083


How can you know that statistics should be updated?

1025


how to increment dates by 1 in mysql? : Sql dba

924


Can sql function call stored procedure?

955


When should I use nosql database?

941


What is sql and also describe types of sql statements?

993


Why do we need a foreign key?

1013


what are the advantages of using stored procedures? : Sql dba

1058


In what condition is it good to disable a trigger?

967