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


Please Help Members By Posting Answers For Below Questions

Explain the rollback statement?

572


What is the maximum database size for sql express?

536


I need a function for a train ticket reservation please answer it thanks in advance

561


What is a rank in sql?

536


what is the difference between char_length and length? : Sql dba

570






What is the life of an sql statement?

523


What is substitution variable in pl sql?

503


what does the t-sql command ident_incr does? : Transact sql

596


What is difference between cursor and trigger?

555


Explain how can you save or place your msg in a table?

593


What is the trigger in sql?

537


Can we join same table in sql?

525


What is faster join or subquery?

510


Explain locks? : Transact sql

572


Explain aggregate functions are available there in sql?

534