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 different types of indexes?

1157


What is BLOCK statements in SQL?

1310


What is dbcc command in sql server?

1149


Explain syntax for viewing trigger?

969


What are three ways you can use an identity value inside a trigger? Why would you prefer one way over another?

1042


SQL Server Architecture ?

2518


What is buffer cash in sql server?

1203


What is lock escalation and what is its purpose?

1024


List some major differences between triggers and stored procedures?

977


Describe and explain about SQL native client?

1155


Explain sql server authentication modes?

1185


What is deploy, process and build? : sql server analysis services, ssas

1153


What is for xml in sql server?

1137


How adventureworkslt tables are related?

981


How to include text values in sql statements?

1095