|
Date: Tue, 30 Sep 2014 11:02:08 -0400
Subject: SQL Recursive Common Table Expression
From: glenn.gundermann@xxxxxxxxx
To: midrange-l@xxxxxxxxxxxx
Hi all,
I'm havnig some difficulties writing a recursive CTE to concatenate a text
field together from multiple rows.
I'm wondering if anyone can help.
I have tables ORDER_HEADER, ORDER_DETAILS, and SERIAL_MASTER.
One header can have multiple details and one detail can have multiple
serial #s.
A single order line item can have more than one machine and hence the
serial # masterfile has multiple rows with the same order# and line item#.
Example of data in SERIAL_MASTER:
Order# Line# Serial#
123456 1 ABC
123456 1 DEF
123456 1 GHI
I would like to produce the following:
Order# Line# Serial #s
123456 1 ABC: DEF: GHI
Any assistance would be greatly appreciated.
Yours truly,
Glenn Gundermann
Email: glenn.gundermann@xxxxxxxxx
Work: (905) 795-2111 ext. 3098
Cell: (416) 317-3144
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.