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

SELECT PROD_CODE ,COUNT(1) FROM TFT_P_PROD WHERE
BRCH_CODE='784'
GROUP BY PROD_CODE;

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is Collation Sensitivity ? What are the various type ?

906


what is 'mysqladmin' in mysql? : Sql dba

974


What is not in sql?

901


What are inner outer left and right joins in sql?

965


Which is faster subquery or join?

1148


Can a key be both primary and foreign?

946


What is nosql vs sql?

1123


tell us something about heap tables. : Sql dba

1049


Explain two easy sql optimizations.

962


Is it possible to link two groups inside a cross products after the cross products group has been created?

955


what is a database transaction? : Sql dba

1108


What is triggering circuit?

1017


Explain 3 basic parts of a trigger.

1256


how would concatenate strings in mysql? : Sql dba

1015


How do I count duplicates in sql?

1033