我想通过加入6个表格来生成夏季报告
类别包含投资领域(矿产,农业,建筑等)的列表
投资内容包含许可编号,投资者ID,类别ID
投资者包含性别,investor_id,姓名..
investment_details联系人investment_id,proposed_investment_amount,real_invested_amount,proposed_male_employment,proposed_female_employment,real_male_employment real_female_employment
investment_status持有investment_detail_id和project_status_id
project_status保留project_status_id和说明(pre-implementation, implementation, operation, canceled
)
我的报告预计会生成mineral, agricultural, construction
和male
的类别(针对female
),投资额(取决于if project status is operation sum of real_invested_amount else proposed_investment_amount
)就业(取决于{{ 1}})和项目状态计数(每个project status is operation sum of real_male_employment+real_female_employment else proposed_male_employment+proposed_female_employment
)。
任何有效的提示或代码将不胜感激
我的sql表和插入数据如下
pre-implementation, implementation, operation, canceled