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

How to include date and time values in sql statements?

1073


What are some of the pros and cons of not dropping the sql server builtinadministrators group? : sql server security

962


What is an example of a foreign key?

962


What is data modeling and Reterminal integrity?

1944


What is the difference between the 2 operating modes of database mirroring?

1091


Explain features and concepts of analysis services?

960


Why is the need for data conversion transformations?

1033


how to control the amount of free space in your index pages? : Sql server database administration

1020


What are the general features of sql server management studio? : sql server management studio

1060


How to start sql server browser service?

1117


How many null values we can have in a unique key field in sql server?

933


What are triggers in ms sql server?

1144


what are cursors? : Sql server database administration

1039


what are database files and filegroups? : Sql server database administration

924


How do you maintain database integrity where deletions from one table will automatically cause deletions in another table?

1175