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 / manas

select col1,count(*)cnt from T1 group by col1

Is This Answer Correct ?    8 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is 'trigger' in sql? : Sql dba

1082


how many sql ddl commands are supported by 'mysql'? : Sql dba

1020


What are expressions?

1009


Why commit is not used in triggers?

1038


What is sap sql?

976


What is the syntax and use of the coalesce function?

1168


Is pl sql and postgresql same?

1123


tell us something about heap tables. : Sql dba

1096


What is an ndf file?

990


Define select, insert, create, delete, update, drop keywords

1044


explain about mysql and its features. : Sql dba

1014


What is a left join?

951


How does sql*loader handles newline characters in a record? : aql loader

1041


Should I use mbr or gpt?

1024


Does sql full backup truncate logs?

1014