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 / saravanan p

Select cast(idKey as varchar)+'('+cast(count(idKey) as
varchar)+')'
from #tbl1 group by idKey

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to select true false based on column value in sql server?

1039


What is “begin trans”, “commit tran”, “rollback tran” and “savetran”?

1030


What is a data source or ds? : sql server analysis services, ssas

1011


How does SSIS(Sql Server Integration Services) deffer from DTS(Data Transformation Services)?

1215


What are the properties and different types of sub-queries?

1015


What are magic tables in sql server?

1140


what are candidate key, alternate key and composite key? : Sql server database administration

921


How to list all login names on the ms sql server?

1147


Define synonym?

1180


Differentiate between a primary key and a unique key.

1076


Some queries related to SQL

986


What is a with(nolock)?

987


How do I find the query plan in sql server?

967


What is Service Broker in sql server 2012?

1026


Where are sql server usernames and passwords stored in the sql server?

1119