SELECT * FROM inquiry e,sales_lead sl,customer c,project p where((e.customer_id = c.customer_id和e.project_id = p.project_id)或e.sales_lead_id = sl.sales_lead_id)和e.delete_status<大于1
答案 0 :(得分:0)
使用以下JOIN查询:
SELECT * FROM enquiry e
LEFT OUTER JOIN sales_lead sl ON e.sales_lead_id=sl.sales_lead_id
LEFT OUTER JOIN customer c ON e.customer_id=c.customer_id
LEFT OUTER JOIN project p ON e.project_id = p.project_id
WHERE e.delete_status <> 1