Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 / pradip jain

select convert(varchar,key) + '('+ convert(varchar,
count(key))+')' from table_name group by key

Hanamesh, why top 20?

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write the SQL query to drop, truncate and delete table.

916


Can a cursor be updated? If yes, how you can protect which columns are updated?

1032


What are pages and extents? : SQL Server Architecture

959


Thanks to some maintenance being done, the sql server on a failover cluster needs to be brought down. How do you bring the sql server down?

894


what changed between the previous version of sql server and the current version? : Sql server database administration

957


Can two tables share the same primary key?

858


Define the one-to-one relationship while designing tables.

858


What is the maximum size of a dimension? : sql server analysis services, ssas

1002


Explain datetime2 data type in sal server 2008?

856


What is log shipping? Can we do logshipping with SQL Server 7.0 - Logshipping is a new feature of SQL Server 2000. We should have two SQL Server - Enterprise Editions. From Enterprise Manager we can configure the logshipping. In logshipping the transactional log file from one server is automatically updated into the backup database on the other server. If one server fails, the other server will have the same db and we can use this as the DR (disaster recovery) plan.

2714


What is the difference between rank and dense_rank?

991


Which is better statement or preparedstatement?

870


How does a profiler work?

873


Can another user execute your local temporary stored procedures?

942


Tell me what is de-normalization and what are some of the examples of it?

958