No, the table isn't appearing first because it's a right outer join. It's a right outer join because the table is appearing first. I didn't have it as a right outer at first. And that's when I noticed that it was showing first in the joins, so I switched it to right thinking that that would solve my problem. But, it didn't.
Well, I have a table of shipment data and I have tables of customer and supplier info. The shipment data should be the main table with left joins to all the others, but a sub-table of the customer table is showing up first. The main problem is that sometimes the field that is being pulled from that sub-table is NULL and therefore it's not pulling in anything for that record. A right outer join is supposed to fix that, but it isn't.
I don't see how showing you the sql could possibly help as I don't need to know what's wrong with it. I only need to know how to control it since I can't go in and change it manually. But, here you go. I might just actually start over and make sure that it's doing it right at each stage.
SELECT oe_hdr.customer_id,
vessel_report.supplier_id,
vessel_report.vessel_name,
vessel_report.est_avail_ship_date,
vessel_report.arrival_date,
address.name,
address.mail_address1,
address.mail_address2,
address.mail_city,
address.mail_state,
address.mail_postal_code,
address.mail_country,
address.central_phone_number,
address.central_fax_number,
contacts.first_name,
contacts.last_name,
oe_hdr.ship2_name,
oe_hdr.ship2_add1,
oe_hdr.ship2_add2,
oe_hdr.ship2_city,
oe_hdr.ship2_state,
oe_hdr.ship2_zip,
oe_hdr.ship2_country,
oe_hdr.ship_to_phone,
class.class_type,
class.class_number,
class.class_description,
address_1.central_fax_number,
contacts_1.first_name,
contacts_1.last_name,
customer.customer_name,
supplier.supplier_name
FROM (((((class
RIGHT OUTER JOIN (((vessel_report
LEFT OUTER JOIN po_hdr ON vessel_report.po_no=po_hdr.po_no)
LEFT OUTER JOIN supplier ON vessel_report.supplier_id=supplier.supplier_id)
LEFT OUTER JOIN oe_hdr ON po_hdr.sales_order_number=oe_hdr.order_no) ON class.class_id=oe_hdr.class_2id)
LEFT OUTER JOIN address ON oe_hdr.carrier_id=address.id)
LEFT OUTER JOIN contacts ON oe_hdr.carrier_id=contacts.address_id)
LEFT OUTER JOIN address_1 ON oe_hdr.address_id=address_1.id)
LEFT OUTER JOIN contacts_1 ON oe_hdr.contact_id=contacts_1.id)
LEFT OUTER JOIN customer ON oe_hdr.customer_id=customer.customer_id
WHERE class.class_type='OE' AND class.class_number=2 AND (vessel_report.est_avail_ship_date>={ts '2008-10-01 00:00:00'} AND vessel_report.est_avail_ship_date<{ts '2008-10-01 00:00:01'}) AND vessel_report.vessel_name=VESSEL NAME AND customer.customer_name=CUSTOMER NAME AND supplier.supplier_name=SUPPLIER NAME