MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » June 2013

Re: Merge of 2 similar files



fixed

On 26 Jun 2013 08:14, Hoteltravelfundotcom wrote:
I want to merge the data from 2 PF but having the same field names
in the new file.

file1: ITEM1, ITEM2, ITEM3, OTHER1
file2: ITEEM1, ITEEM2, ITEEM3, OTHER1

NEW_FILE:
ITEM1
ITEM1 (** was called ITEEM1)
ITEM2
ITEM2 (** Was called ITEEM2)
ITEM3
ITEM3 (** WAS called ITEEM3)
OTHER1
OTHER1

So almost exactly like the SQL statement that Scott offered earlier, is presumably an acceptable resolution. However there was still no clarification of what is the /reporting/ being utilized to enable one to know or infer if the SQL VIEW may be acceptable; e.g. if the file must be keyed in order for the /reporting/ to function properly, then a VIEW can not suffice by itself. A revision of the statement offered earlier, follows the link to the archived message with that statement:
http://archive.midrange.com/midrange-l/201306/msg01048.html

CREATE VIEW NEW_FILE (ITEM1, ITEM2, ITEM3, OTHER1) AS
SELECT ITEM1, ITEM2, ITEM3, OTHER1
FROM file1
UNION ALL /* or maybe desirable instead: UNION DISTINCT */
SELECT ITEEM1, ITEEM2, ITEEM3, OTHER1
FROM file2






Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot 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 here. If you have questions about this, please contact