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 difference between getdate and sysdatetime in sql server 2008?

791


What are the steps to follow to configure SQL*Net?

787


What is log shipping? Can we do logshipping with SQL Server 7.0 ?

766


What are a scheduled jobs or what is a scheduled tasks?

663


Can we insert data if clustered index is disabled?

687


How do I start sql server 2016?

702


Please explain go command in sql server?

784


How to get the definition of a stored procedure back?

717


What are four major operators that can be used to combine conditions on a where clause?

771


If you're given a raw data table, how would perform etl (extract, transform, load) with sql to obtain the data in a desired format?

733


Do you know what are the reporting services components?

721


Explain how dts is used to extract, transform and consolidate data?

770


What do you understand by user-defined function in the sql server?

710


What are different replication agents and what's their purpose? : sql server replication

762


How can windows applications connect to sql servers via odbc?

820