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

What are extended events in sql server?

937


Mention the differences between sql server and mysql.

998


What is the difference between sdf and mdf?

1281


What is a bit datatype?

963


How does clustered and non clustered index work?

900


It is important form e to get the information from log files of applications executed by the task scheduler? Does sql studio save these log files? : sql server management studio

1009


What is data compression? : sql server database administration

956


What is the importance of a recovery model?

1032


What is Transparent Data Encryption?

988


What is deploy, process and build? : sql server analysis services, ssas

1084


What do you think of this implementation? Can this be implemented better?

918


What is the difference between count () and rowcount ()?

1001


What are the differences between DDL, DML and DCL in SQL?

1206


A trigger can reference objects outside the current database? State true or false.

988


How to transfer data from a cursor to variables with a "fetch" statement?

1070