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 do you understand by recursive stored procedures?

937


Which sql server is best?

952


What is sql view?

953


What are trace flags and mention a few common trace flags used with sql server?

1035


Tell me what is the significance of null value and why should we avoid permitting null values?

928


How many types of attribute relationships are there? : sql server analysis services, ssas

999


Can multiple columns be used in sql group by clause in ms sql server?

984


How do I find the sql server database version?

939


optimization techinques

2634


What is the user of Primary key?

922


What is used to replicate sessions between instances in coldfusion clusters?

1015


What are the advantages of policy management?

942


how can you check the level of fragmentation on a table? : Sql server administration

918


How many columns can we include on clustered index ?

923


Explain following error properties?

954