考虑:
Select Dash_Bill_ID As 'رقم الفاتورة',
c2.Customer_Name As 'العميل',
c1.Customer_Name As 'المهندس/المقاول',
delegate.Delegate_Name As 'المندوب',
Total_CostBD As 'الاجمالي قبل الخصم',
Total_CostAD As 'الاجمالي بعد الخصم',
Bill_Date As 'التاريخ',
Type_Buy As 'طريقة الدفع',
Initial_Value As 'العربون',
bank.Bank_Name As 'الخزنة'
From customer_bill
Full Outer Join customer As c1
On c1.Customer_ID = customer_bill.Customer_ID
Full Outer Join customer As c2
On c2.Customer_ID = customer_bill.Client_ID
Full Outer Join delegate
On delegate.Delegate_ID = customer_bill.Delegate_ID
Full Outer Join bank
On bank.Bank_ID = customer_bill.Bank_ID
Where Dash_Bill_ID = 24;
我收到错误:
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outer join customer as c1 on c1.Customer_ID=customer_bill.Customer_ID full outer' at line 1
最佳答案
MySQL 不支持 FULL JOIN
,这是您遇到的具体问题。
但是,完全不可能需要 FULL JOIN
。在结构良好的数据库中,几乎不需要完全连接。假设 customer_bill
中所有引用的字段均非 NULL
,则 INNER JOIN
应该没问题。或者,您可能需要LEFT JOIN
。
关于mysql - 全外连接SQL错误jj,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46470530/