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 / manas
select col1,count(*)cnt from T1 group by col1
| Is This Answer Correct ? | 8 Yes | 2 No |
Post New Answer View All Answers
Explain dml and ddl?
Is full outer join same as cross join?
what is the difference between cluster and non cluster index? : Sql dba
What is a file delimiter?
What is secondary key?
what is the difference between group by and order by in sql? : Sql dba
what is try_catch block in procedure
How to get list of all tables from a database?
First round ------------------- - Procedure - Packages - Views - Virtual tables - Can we use dcl with in function? - Joins and few scenarios - Triggers and its type - Pragma, type and its functionality - How to create db link in oracle - Materialized view - How to find duplicate values from table? - Cursor and its functionality - Write a script to display friday and its date from a entire year. - Exception Handling Second round ------------------------ Gave a scenario like. Need to write a function to perform. When user try to change a password. It must not be last five password and a given password can be combination of characters, symbols, upper and lower case.
What is cold data?
How do you use join?
How you improve the performance of sql*loader? : aql loader
Can we commit in trigger?
what are the advantages and disadvantages of cascading style sheets? : Sql dba
Is sql pronounced sequel or sql?