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 / hanamesh havale

select top 10 cast(key as varchar)
+ '(' + cast(count(key) as varchar) + ')'
from TableName
group by key


Hanamesh Havale
Influx Infotech

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can an entity have two primary keys?

938


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

947


How to use union to merge outputs from two queries together in ms sql server?

1022


What are the differences between stored procedure and the dynamic sql?

1045


How to divide query output into multiple groups with the group by clause in ms sql server?

984


How to create nested stored procedure?

976


Types of Authentications in Sql Server? How user gets authenticated through windows authentication?

1004


What is the stuff?

956


Different types of keys in SQL?

1057


What is difference between clustered and non clustered index?

940


What are the new features are introduced in sql server 2012 reporting services?

147


What is perspective, have you ever created perspective? : sql server analysis services, ssas

873


is there a column to which a default can't be bound? : Sql server database administration

980


Explain the properties of subqueries in sql server?

1034


How to create user messages with print statements in ms sql server?

947