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

How to update multiple rows with one update statement in ms sql server?

853


Can a unique index be created on a column, which contains null?

713


what kind of lan types do you know? : Sql server database administration

707


What is multi-statement table-value user-defined function?

724


What is sql injection and why is it a problem? : sql server security

740






Explain the properties of sub-query in sql server?

728


How to rebuild all indexes on a single table?

772


What is dynamic cursor in SQL SERVER?

740


Explain isolation levels that sql server supports?

763


How will you optimize a stored procedure optimization?

676


Explain index in sql server?

754


What is the use of floor function in sql server?

729


What is the difference between grant and with grant while giving permissions to the user?

728


Write the syntax for stuff function in an sql server?

724


What is a partitioned view?

769