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

Is sql the best database?

503


What are the three forms of normalization?

524


Which function is used to return remainder in a division operator in sql?

584


Is a secondary key the same as a foreign key?

488


Why do we use sql constraints?

662






What are the different type of joins in sql?

544


How do I view an execution plan in sql?

529


How do you modify a table in sql?

565


What is group by in sql?

548


What is sqlite format?

631


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

600


What are character functions in sql?

496


Where the sql database files are stored?

490


how many tables will create when we create table, what are they? : Sql dba

542


Mention what does plvtab enables you to do when you showthe contents of pl/sql tables?

671