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 / manju

select key,count(key)as"count of items" from tablename
group by key order by key

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 constraints?

986


What is the difference between varchar and nvarchar?

929


Explain a checkpoint?

1013


How to make remote connection in database?

991


How to use user defined functions in expressions?

1060


Write a SQL query to make a column as unique?

1015


What is a trace frag? Where do we use it?

1086


How many servers can we create in a single subscription?

160


What is difference between getdate and sysdatetime in sql server 2008?

1040


What are the kinds of subquery?

998


How do you create an execution plan?

926


What are triggers? How many triggers you can have on a table? How to invoke a trigger on demand?

1175


Why is the need for data conversion transformations?

1033


What is t-sql script to take database offline – take database online.

1061


How do I find sql server instance name?

947