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 identity column in sql server?
How do you take the union of two tables in sql?
What is the source code of a program?
What is a delimiter in sas?
what is the functionality of the function htmlentities? : Sql dba
what is the use of double ampersand (&&) in sql queries?
What is trigger and how to use it in sql?
Is pl sql better than sql?
What is right join in sql?
What is difference between rank () row_number () and dense_rank () in sql?
How many types of triggers are there in pl sql?
What is cursor in pl sql?
In pl/sql, what is bulk binding, and when/how would it help performance?
How do you rename a table in sql?
How do I know if I have sql express or standard?