I want to return some data from a SQL Table.
I have an Order number that brings back List of item Numbers from the order table (opdetm).
This looks at the Stock Table (stockm) and returns a supplier code.
This then looks at the supplier table (plsuppm) and returns the Address Details.
however Sometimes The Item number "Supplier" field will be blank (ie made in house)
With my current Query these items are missed off. I think this is the difference with an outer and an inner join?
Is there any way I can change my SQL code to return all values from opdetm, even when stockm.supplier is blank?
I have an Order number that brings back List of item Numbers from the order table (opdetm).
This looks at the Stock Table (stockm) and returns a supplier code.
This then looks at the supplier table (plsuppm) and returns the Address Details.
however Sometimes The Item number "Supplier" field will be blank (ie made in house)
With my current Query these items are missed off. I think this is the difference with an outer and an inner join?
Is there any way I can change my SQL code to return all values from opdetm, even when stockm.supplier is blank?
Code:
SELECT opdetm.order_line_no, opdetm.product, opdetm.description, stockm.supplier, plsuppm.name, plsuppm.address1, plsuppm.address2, plsuppm.address3, plsuppm.address4, plsuppm.address5
FROM ihwt.scheme.opdetm opdetm, ihwt.scheme.plsuppm plsuppm, ihwt.scheme.stockm stockm
WHERE opdetm.product = stockm.product AND opdetm.warehouse = stockm.warehouse AND plsuppm.supplier = stockm.supplier AND ((opdetm.order_no=?))