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 are the different operators available in sql?
how to convert numeric values to character strings? : Sql dba
what are tables and fields? : Sql dba
Differences between Oracle 9i and 10g (Probably in terms of SQL and PL/SQL)?
What is a system versioned table?
What is the example of procedure?
what does it mean to have quoted_identifier on? : Sql dba
What is a primary key called that is made up of more than one field?
What is sql catalog?
What is the difference between partition and index?
Sql technical questions
What are the syntax and use of the coalesce function?
What are the commands used in sql?
Is mariadb a nosql database?
What is the difference between join and natural join?