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 does <> sql mean?

526


What is synchronized subquery?

583


how many groups of data types? : Sql dba

557


When do we use triggers?

579


explain access control lists. : Sql dba

543






What are dml commands?

517


How can triggers be used for the table auditing?

586


Can we insert in view in sql?

556


What is a data definition language?

546


Can a foreign key be a duplicate?

497


What is having clause in sql?

519


Can cursors be part of a trigger body?

1102


Do we need to rebuild index after truncate?

520


What are the basic sql commands?

540


How to call a javascript function from pl sql?

554