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 common performance issues in sql server?

702


You want to implement the one-to-many relationship while designing tables. How would you do it?

744


What is the difference between upgrade and migration in sql server?

814


What extended events?

811


What is the recovery model? List the types of recovery model available in sql server?

697


Can coalesce return null?

780


In which tcp/ip port does sql server run? Can it be changed?

777


Where are sql server usernames and passwords stored in the sql server?

837


What does COMMIT command do?

823


Describe different Processing Modes offered by SSRS?

206


Why use triggers?

820


What is inline table-value user-defined function?

816


what are defaults? : Sql server database administration

756


How does Report Builder support Analysis Services cubes?

136


When columns are added to existing tables, what do they initially contain?

842