May be I misunderstand what you need, ... but what about:
Joining File 1 with File 2 (inner join - returns only rows found in both
tables)
Joining File 1 with File 3 (inner join)
And then merging the result of both sub-selects?
Select *
From (Select aCol1, bCol2
From TableA join TableB on aCol1 = bCol1)
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"
?Train people well enough so they can leave, treat them well enough so they
don't want to.? (Richard Branson)
-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Alan
Shore
Sent: Freitag, 30. Juni 2017 19:50
To: midrange-l@xxxxxxxxxxxx
Subject: Using SQl to obtain a field value from one file or another
Hi everyone
Before I forget - we are on V7r1
Happy 4th July weekend to the yanks
I may be pushing my luck - Friday afternoon before what could be a 4 day
weekend for many people But - here goes I will try and keep this as simple
as possible
I have 3 files
File-1 has one field with values
A
B
C
D
E
Etc.
File-2 contains 2 fields
Field 1 contains an alpha character with SOME of the values that are in
file-1 Field 2 is just data
File-3 also contains 2 fields
Field 1 contains an alpha character with SOME of the values that are in
file-1 Field 2 is just data
NOTE - the values A,B,C,D, E etc. will be in either File-2 or File-3 but NOT
both
How can I combine whats in file-1 with File-2 field 2 and File-3 field 2 but
in ONLY 2 columns For example - this is what I am looking to produce from an
SQL statement
A Field2 from File-2
B Field2 from File-2
C Field2 from File-3
D Field2 from File-3
E Field2 from File-2
I tried the following
Select File-1.Field1, File-2.Field2, File-3.Field2 from File-1 left join
File-2 on
File-1.Field1 = File-2.Field1
left join File-3 on
File-1.Field1 = File-3.Field1
But that results in three columns - not 2
As always - all responses gratefully accepted
Alan Shore
E-mail : ASHORE@xxxxxxxx
Phone [O] : (631) 200-5019
Phone [C] : (631) 880-8640
'If you're going through hell, keep going.'
Winston Churchill
--
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.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
http://amzn.to/2dEadiD
As an Amazon Associate we earn from qualifying purchases.