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 are the different operators available in sql?

1059


how to convert numeric values to character strings? : Sql dba

1162


what are tables and fields? : Sql dba

1105


Differences between Oracle 9i and 10g (Probably in terms of SQL and PL/SQL)?

3624


What is a system versioned table?

1043


What is the example of procedure?

979


what does it mean to have quoted_identifier on? : Sql dba

1181


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

1393


What is sql catalog?

1068


What is the difference between partition and index?

1061


Sql technical questions

1336


What are the syntax and use of the coalesce function?

1277


What are the commands used in sql?

1135


Is mariadb a nosql database?

1102


What is the difference between join and natural join?

984