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 is the difference between value type and reference type?

557


What do you mean by tablesample?

642


what are the disadvantages of cursors? : Sql server database administration

496


How to add an address record into adventureworkslt?

574


What are the properties of the transactions?

617






What is the difference between for trigger and after trigger?

547


What is tabulation?

564


What are the disadvantages of primary key and foreign key in SQL?

634


what is an extended stored procedure? : Sql server database administration

505


how you can configure a running aggregate in SSRS?

114


What happens if you delete a table that is used by a view?

568


How to modify existing triggers using "alter trigger"?

532


How to convert character strings into numeric values?

582


How do I create a stored procedure in dbml?

518


explain the difference between oracle- sql and sql server sql ? if both are same y we r using 2 sw.s?

1989