vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Taking the Northwind database as an example, I have an order table: 'Orders' a order details table: 'Order Details' and a products table: 'Products' 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? Many thanks, Neil |
| |||
| 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/pro...ads/books.mspx Books Online for SQL Server 2000 at http://www.microsoft.com/sql/prodinf...ons/books.mspx |
| |||
| --CELKO-- wrote: >>> 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. |
| ||||
| On May 21, 3:27 am, Ed Murphy <emurph...@socal.rr.com> wrote: > --CELKO-- wrote: > >>> 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. I know it's bad practice to do it that way and a seperate reporting layer like crystal reports etc would be lovely, but I'm in a situation where I don't have those kind of facilities and budgets at my disposal. It's just a means to an end. I'm certainly not holding data like that. It's bad enough dealing with internal politics without having to deal with it again on here! Thanks to you all for your kind (or not so kind) input. Neil |