I have 2 tables document_line where planned work lines are saved and document_line_entry where entered work lines are saved.
I do not know why but i cant get all lines back (expecting 5)
Any ideas whats wrong?
Based on the data sample you provided, the result you are getting IS correct. line_no 1 from document_line matches the two records on document_line_entry, where line_nos 2 and 3 do not, so you get nulls in the values.
The only time you get a null row is when there are NO matches at all.
I’m sorry. I just don’t understand. In the OP, you were talking about planned and entered work, now you’re talking what looks to be a pack of goods mailed to you that is distributed to different areas?
I… COULD be wrong, but what I think he’s trying to do here Dave could be solved as:
ON e.line_no = a.line_no AND e.bin = a.bin
It wouldnt quite give him the result he expects, but it would be the right number of rows.
(Essentially what i think he’s looking for is “Find where things didnt end up in the right place.”… so any row where planned_shelf is Null is a misplaced item, and any row where shelf_fact is Null is a line item that is missing…?)