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 / madhu sudhan g

Hiiiii

Lets the table name is No1 having column A is of int data Type
Now the query is
select convert(nvarchar(5),A) + '(' +
convert(nvarchar(5),count(1))+')' from NO1 GROUP BY A

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain encryption of entire databases without the need for application changes in sql server 2008?

1046


Explain foreign key in sql server?

1031


What is the usage of sign function?

1115


What is a mixed extent?

1026


What is etl - extraction, transformation, and loading?

919


Which are the important points to note when multilanguage data is stored in a table?

998


How to filter records of table in SQL SERVER?

1086


Can you pass expressions to stored procedure parameters?

1037


Do you know the capabilities of cursors?

1150


How to loop through returning rows?

1037


how to use DTS package in 2000,2005,2008 in sql server

1838


what is difference between NULL and ISNULL in SQL Server 2008?

1017


What is a view and what are its advantages?

1114


What are the differences between char and varchar in ms sql server?

1066


Can a table have 2 foreign keys?

906