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...

there is a table having two columns no and name
and the data is
1 A
2 B
3 C

write a query that will result a horizontal output
A,B,C

Answer Posted / rajesh.a

declare @res varchar(max)

set @res=''

select @res=@res+name+',' from table

select @res=substring(@res,1,len-1)

print @res

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to use order by with union operators in ms sql server?

1002


What do you mean by acid?

973


What is a primary index?

911


What are the fixed server level roles? : sql server security

1105


What is rank function?

1015


Explain the creation and execution of a user-defined function in the sql server?

1031


How to download microsoft sql server 2005 express edition?

1029


What is the difference between varchar and nvarchar datatypes?

1069


What is database white box testing?

1107


How to start and end transact-sql statements?

1004


Where is trigger in sql server?

1026


What is the difference between index seek vs. Index scan?

1009


What are the benefits and tasks of object explorer? : sql server management studio

1154


Explain ms sql server reporting services vs crystal reports?

903


What is temporal data type?

903