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 different index configurations a table can have?

507


Do you know what are the reporting services components?

521


Difference between group by clause and having clause in SQL?

561


What is right outer join in sql server joins?

679


Explain primary key, foreign key and unique key?

533






What does REVERT do in SQL Server 2005?

548


Explain the difference between control flow and data flow?

521


in the physical file layout, where should the transaction log be stored in relation to the data file? : Sql server administration

544


Define outer join?

528


What is an example of a foreign key?

502


Explain what are page splits? : SQL Server Architecture

648


How do you create a data source?

463


What is a linked server in sql server?

567


What is cdc in sql server?

562


After creating the cube, if we added a new column to the oltp table then how you add this new attribute to the cube? : sql server analysis services, ssas

561