Two exact files - but they don't match

%3CLINGO-SUB%20id%3D%22lingo-sub-2191586%22%20slang%3D%22en-US%22%3ETwo%20exact%20files%20-%20but%20they%20don't%20match%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2191586%22%20slang%3D%22en-US%22%3E%3CP%3EI've%20written%20a%20SELECT%20DISTINCT%20query%2C%20comparing%20FileA%20to%20FileB%2C%20WHERE%20all%20fields%20(7)%20of%20both%20files%20must%20match.%20The%20ORDER%20BY%20is%20on%20ID%20and%20Dates.%20I%20should%20see%20a%20list%20of%20all%20the%20records%20from%20FileA%2C%20but%20the%20results%20drop%20all%20the%20records%20of%20certain%20IDs%20%E2%80%93%20a%20total%20of%20943%20records%20from%20the%205697%20total.%20Any%20ideas%20why%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2191586%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAccess%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New Contributor

I've written a SELECT DISTINCT query, comparing FileA to FileB, WHERE all fields (7) of both files must match. The ORDER BY is on ID and Dates. I should see a list of all the records from FileA, but the results drop all the records of certain IDs – a total of 943 records from the 5697 total. Any ideas why?

4 Replies
Not without seeing the data. And not without seeing the actual SQL.
What does the term "files" mean in this context, by the way?
I can venture a guess as to the explanation, based on this comment "... all fields (7) of both files must match." It would appear that in those records, that is not the case, one or more of those fields differs between the two tables. It may be worthwhile to identify one candidate of that group of 943 records and study it in detail in both tables.

@George Hepworth 

My thanks for your comment. I realized that there was a null condition that I hadn't accounted for. All good now. Thanks, again, for taking the time to respond.

 

PS> by "files", I was referring to the Tables I use. Sorry for the confusion. I was once a mainframe programmer.

Congratulations on spotting the discrepancy. Nulls are tricky little devils.
Continued success with the project.