请帮助我解决此错误。
SELECT tbl_customer.*,tbl_branch.*,tbl_loan.*
FROM tbl_customer
LEFT JOIN tbl_branch
ON tbl_branch.id = tbl_customer.cust_branch, tbl_loan
LEFT JOIN tbl_loan
ON tbl_loan.cust_id = tbl_customer.id
WHERE tbl_customer.cust_branch='1'
AND tbl_loan.status = 0
ORDER BY tbl_customer.id DESC
答案 0 :(得分:1)
您在查询中有一个额外的,
,请尝试:
select `tbl_customer`.*, `tbl_branch`.*, `tbl_loan`.*
from `tbl_customer`
left join `tbl_branch`
on `tbl_branch`.id=`tbl_customer`.cust_branch
left join `tbl_loan`
on `tbl_loan`.cust_id=`tbl_customer`.id
where `tbl_customer`.cust_branch='1'
and `tbl_loan`.status=0
ORDER BY tbl_customer.id DESC