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 / piyush sachan

DECLARE @List VARCHAR(8000)
SELECT @List = ISNULL(@List + ',', '') +names
FROM NewNew

SELECT @List

Orrrrrr

DECLARE @List VARCHAR(8000)
SELECT @List = COALESCE(@List + ',', '') +names
FROM NewNew

SELECT @List

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

965


What are the different ways you can create databases in sql server?

1097


What is an indexing technique?

925


What is the difference between left and right outer join?

1056


What does it mean to invest in the index?

956


What is SQL Azure?

105


How to retrieve error messages using odbc_errormsg()?

1044


What do you mean by authentication modes in sql server?

1079


What is user-defined functions? What are the types of user-defined functions that can be created?

1029


What is instead of dml trigger?

994


What are three major types of constraints?

1107


What is the latest version of microsoft sql server?

1038


What is a natural primary key?

1017


What is a join in sql?

1079


how would you improve etl (extract, transform, load) throughput?

1020