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

What are the 2 types of classifications of constraints in the sql server?

580


Explain the stored procedure?

627


Explain optimistic and pessimistic concurrency?

534


What is the Main Difference between ACCESS and SQL SERVER?

555


What is a self join in sql server?

584






Explain syntax for dropping triggers?

510


What is the cpu pressure?

558


What is the recommended total size of your memory optimized tables?

519


What is @@error in sql?

616


How to verify a user name with sqlcmd tool?

577


What are the risks of storing a hibernate-managed object in a cache? How do you overcome the problems?

590


What are the different index configurations a table can have?

507


What are diverse clauses that form a part of sql?

593


How to make conditional sum in ssrs?

128


you have developed an application which uses many stored procedures and triggers to update various tables users ocassionally get locking problems which tool is best suited to help you diagnose the problem? : Sql server administration

527