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 is pl/sql table? Why it is used?
What are the parameter modes supported by pl/sql?
How do I find sql profiler?
how is myisam table stored? : Sql dba
what is blob? : Sql dba
Which normal form is best?
What do you mean by table in sql?
Can we use insert statement in function?
How to run sql commands in sql*plus?
What are actual parameters and formal parameters?
how to select first 5 records from a table? : Sql dba
How many types of keys are there in sql?
Can we create foreign key without primary key?
Which one is better subquery or joins?
How does cross join work in sql?