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 / rajkumar.v

select convert(varchar,id) + '(' + CONVERT(varchar,count
(id)) + ')' as tot from tblname group by id

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to execute the cursor queries with "open" statements?

1100


Do you know sql server 2008 backup compression?

922


What is transaction server consistency?

982


What are the events recorded in a transaction log?

933


If you want to send some data from access database to sql server database. What are different component of ssis will you use?

922


How to declare and use cursor variables?

1078


Define right outer join in sql server joins?

983


What is dynamic cursor in SQL SERVER?

1003


Explain user defined functions?

948


Can we call stored procedure in view in sql server?

862


What are the built in functions in sql server?

919


Difference between DELETE and TRUNCATE?

1004


How to Insert multiple rows with a single insert statement?

1002


Can the query output be sorted by multiple columns in ms sql server?

937


What is scalar user-defined function?

1001