dbTalk Databases Forums  

Re: Multiple values into single cell

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Re: Multiple values into single cell in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: Multiple values into single cell - 05-18-2007 , 03:47 PM






NAJH (neilonusenet (AT) yahoo (DOT) co.uk) writes:
Quote:
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 (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
  #2  
Old   
--CELKO--
 
Posts: n/a

Default Re: Multiple values into single cell - 05-20-2007 , 04:41 PM







Quote:
For reasons best ignored, ...
Do not ignore the reasons; so, why do you want to write stinking bad
code?



Reply With Quote
  #3  
Old   
Ed Murphy
 
Posts: n/a

Default Re: Multiple values into single cell - 05-20-2007 , 09:27 PM



--CELKO-- wrote:

Quote:
For reasons best ignored, ...

Do not ignore the reasons; so, why do you want to write stinking bad
code?
At least he isn't talking about storing the data that way, merely
outputting it that way. That said, I would do it in a separate
reporting layer (e.g. Crystal Reports) if at all possible.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.