Let's say I have 2 tables - PurchaseOrderLine and PurchaseOrderLineAllocation.They both have a field named OrderLineID, but only 1 of them will ever be populated.
I need to join a 3rd table (OrderLine) to a 4th table (StockReceiptLine) via one of those 2 tables.
As it stands, the path would be:
- OrderLine.OrderLineID - PurchaseOrderLine.OrderLineID
- PurchaseOrderLine.PurchaseOrderLineID - StockReceiptLine.PurchaseOrderLineID
or
- OrderLine.OrderLineID - PurchaseOrderLineAllocation.OrderLineID
- PurchaseOrderLineAllocation.PurchaseOrderLineID - StockReceiptLine.PurchaseOrderLineID
I vaguely remember hearing isnull stops the optimizer from using indexes properly - would using isnull as part of the joins cause any kind of performance issues? If so, what would be the preferable option in this situation?
SQL
FROMOrderLineolLEFTJOINPurchaseOrderLine...