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 / purushotham
SELECT PROD_CODE ,COUNT(1) FROM TFT_P_PROD WHERE
BRCH_CODE='784'
GROUP BY PROD_CODE;
| Is This Answer Correct ? | 0 Yes | 3 No |
Post New Answer View All Answers
What is trigger in sql?
How does postgresql compare to oracle/db2/ms sql server/informix?
How to get list of all tables from a database?
How is use pl and sql?
What is the difference between local and global temporary table?
What is a table?
How to use transactions efficiently : transact sql
Why do we need pl sql?
What is pragma in sql?
How to pipe multiline string to isql?
How exception handling is done in advance pl/sql?
What is the use of function "module procedure" in pl/sql?
what is sp_pkeys? : Transact sql
What is a field in a database?
How do I restart sql?