我的第一个问题是:
SELECT SUM(expenses.amount) as project_expenses
FROM expenses
WHERE project_id=$project_id
我的第二个问题是:
SELECT customer_deal.*,recipt_no_agency.*,expense_type.exp_head,project.name,
expenses.type_id ,SUM(recipt_no_agency.payment) as pay
FROM customer_deal
LEFT JOIN project ON customer_deal.project_id=project.project_id
LEFT JOIN recipt_no_agency ON recipt_no_agency.recipt_id=customer_deal.id
LEFT JOIN expenses ON expenses.project_id=customer_deal.id
LEFT JOIN expense_type ON expenses.type_id=customer_deal.id
WHERE project.project_id=$project_id
请帮忙。