I need to join records from 2 files (actually 3, but 2 is a good starting point and I can probably figure out how to add more files) for all records in fileA.
insert into OUTFILE select A.FLD1, A.FLD2, A.FLD3, B.FLD4 from FILEA A left outer join FILEB B on A.INTKEY = B.INTKEY where exists(select 1 from CTLFILE C where A.FLD1 = C.FLD1)
So I got the above to work, BUT I need to expand the where clause such that:
where exists(select 1 from CTLFILE C where A.FLD1 = C.FLD1) AND B.FLD5 between :StartDate and :EndDate
Now all I get is an inner join, I lose the non-matching records from FILEA. What did I miss?