if we have a column (Key) in a table.
and values of that column is
Key
1
1
1
2
2
3
3
4
4
5
5
5
and we want to show the data after query..like..

1(3)
2(3)
3(2)
4(2)
5(3)
how many times a single term comes..

Answer Posted / vikas kant

select key,count(key1) from [table_name]
group by key

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of having an index on the sql server?

546


What is trigger explain with program?

540


Explain can SSRS reports Cache results?

112


You have developed an application which uses many stored procedures and triggers to update various tables users ocassionally get locking problems which tool is best suited to help you diagnose the problem?

572


What is the data type of time?

522






How to get a list all databases on the sql server?

583


Explain what is analysis service repository?

538


How many types of functions are there in sql server?

467


What is PROJECTION Operation?

613


What is bit data type?

630


What is microsoft sql server?

543


What is open database communication (odbc)?

573


what are user defined datatypes and when you should go for them? : Sql server database administration

544


Indexes are updated automatically is the full-text index also updated automatically?

629


What is the most common trace flags used with sql server?

524