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 / manju

select key,count(key)as"count of items" from tablename
group by key order by key

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to generate create table script on an existing table in ms sql server?

859


How to connect of datebase with sql express.?

835


What is the current limitation of the size of SQL Azure DB?

120


Explain in brief about Microsoft SQL server?

743


How do I determine how many instances of sql server are installed on a computer?

734


How to rename an existing column with the "sp_rename" stored procedure in ms sql server?

795


Is null vs coalesce?

648


Where to find ntwdblib.dll version 2000.80.194.0?

755


what is raid? : Sql server database administration

733


How to create and drop temp table in sql server?

776


What is the most common type of join?

734


Where do we use trace frag?

740


How does Report Builder support Analysis Services cubes?

136


How many full-text indexes can a table have?

737


What is openxml in sql server?

888