|
Posted by Erland Sommarskog on 05/18/07 20:47
NAJH (neilonusenet@yahoo.co.uk) writes:
> For reasons best ignored, I want to produce a query which has columns:
>
> Orders.OrderID, Products
>
>
> which has results like:
>
> 10248, 'Queso Cabrales, Singaporean Hokkien Fried Mee, Mozzarella di
> Giovanni'
> 10249, 'Tofu, Manjimup Dried Apples'
>
> ________
> so for those who don't really know what I'm on about and haven't got
> access to northwind, I want the second cell to contain the returned
> column of a second query (but in text format)
>
> could anyone suggest a way this could be done? am I entering the land
> of cursors?
If you are on SQL 2000, yes. SQL Server MVP Anith Sen covers the various
methods on http://www.projectdmx.com/tsql/rowconcatenate.aspx.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
[Back to original message]
|