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
What does <> sql mean?
What is synchronized subquery?
how many groups of data types? : Sql dba
When do we use triggers?
explain access control lists. : Sql dba
What are dml commands?
How can triggers be used for the table auditing?
Can we insert in view in sql?
What is a data definition language?
Can a foreign key be a duplicate?
What is having clause in sql?
Can cursors be part of a trigger body?
Do we need to rebuild index after truncate?
What are the basic sql commands?
How to call a javascript function from pl sql?