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


Please Help Members By Posting Answers For Below Questions

What are the 3 modes of parameter?

672


Can we write ddl statements in functions?

559


Is null operator in sql?

596


What is native sql query?

542


What are the various levels of constraints?

656






What is localdb mssqllocaldb?

608


What does plv msg allows you to do?

664


what are the different index configurations a table can have? : Sql dba

562


Do stored procedures prevent sql injection?

538


What is cold data?

496


Explain ttitle and btitle.

666


When is the update_statistics command used?

566


Which are the different character-manipulation functions in sql?

540


What schema means?

515


Explian rowid, rownum? What are the psoducolumns we have?

554