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

select key,count(key) 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

What is use of attribute hierarchy optimized state? : sql server analysis services, ssas

585


What is meant by referential integrity?

589


What are alternate keys?

571


Why use sub query in sql server and list out types of sub queries?

541


What is an identity?

569






Tell me what is a linked server?

564


What are three ways you can use an identity value inside a trigger? Why would you prefer one way over another?

547


Is sql server free?

522


Define self join in sql server joins?

517


Is it important for a database administrator to understand the operating system and file access?

508


Does partitioning improve performance sql server?

487


Explain the concept of view and Types of views in SQL server?

617


What are different types of statements that are supported by sql?

594


List all the types of user-defined functions?

520


What are the different SQL Server Versions you have worked on?

551