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

What are the system database in sql server 2005?

1038


What are the dmvs?

1005


List out the differences between the clustered index and non-clustered index in sql server?

997


What is pessimistic concurrency?

970


Can you use order by when defining a view?

968


How can you fetch alternate records from a table?

954


Difference between aggregate functions of sql?

1095


What are the components of sql server service broker?

1007


What is trigger in salesforce?

975


What program is used to store the data source file?

957


how will add additional conditions in sql?

1089


Distinguish between nested subquery and correlated subquery?

1036


Mention what are the core components of ssrs?

323


What is filter index?

942


How do I connect to sql server database?

1003