ค่ะ นี่ตัวอย่างcode sql ที่errorค่ะ บรรทัดที่ตัวหนาคือjoin ที่errorค่ะ ถ้าเปลี่ยนเป็นLEFT หรื RIGHT ก็จะไม่errorค่ะ
Code
SELECT
expense_trans.et_atid,
expense_trans.et_amount,
expense_trans.et_date,
lc.lc_no,
req_lc.rlc_company,
bank.bank_name,
be.be_lot,
shipping.be_lot ,
tr_receipt.trr_atid
FROM
expense_trans
INNER JOIN expense ON expense_trans.ex_atid = expense.ex_atid
LEFT OUTER JOIN lc ON expense_trans.ref_atid = lc.lc_atid
LEFT OUTER JOIN be ON expense_trans.ref_atid = be.be_atid AND lc.lc_atid = be.lc_atid
LEFT OUTER JOIN shipping ON expense_trans.ref_atid = shipping.sh_atid
LEFT OUTER JOIN paid_tr ON expense_trans.ref_atid = paid_tr.be_atid AND be.be_atid = paid_tr.be_atid
LEFT OUTER JOIN req_lc ON lc.rlc_atid = req_lc.rlc_atid
INNER JOIN bank ON req_lc.b_atid = bank.b_atid FULL OUTER JOIN tr_receipt ON be.be_atid = tr_receipt.be_atid
ORDER BY bank.bank_name,expense_trans.et_date,lc.lc_no,expense.ex_desc