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 Collation Sensitivity ? What are the various type ?
what is 'mysqladmin' in mysql? : Sql dba
What is not in sql?
What are inner outer left and right joins in sql?
Which is faster subquery or join?
Can a key be both primary and foreign?
What is nosql vs sql?
tell us something about heap tables. : Sql dba
Explain two easy sql optimizations.
Is it possible to link two groups inside a cross products after the cross products group has been created?
what is a database transaction? : Sql dba
What is triggering circuit?
Explain 3 basic parts of a trigger.
how would concatenate strings in mysql? : Sql dba
How do I count duplicates in sql?