select d.departname 部门, a.plan_num 计划号, a.plan_row_num 计划行号, a.purchase_order_num 订单号, a.purchase_order_line_item_code 订单行号, a.full_approval_flag 计划审批状态, a.material_code 物资编码, a.material_description 物资描述, e.material_code 集采物资编码, f.material_code 一级集采目录物资, a.submission_date 提报日期, g.distribution_date 计划下发日期, a.order_creation_date 订单日期, a.category_code 大类, a.category_name 大类描述, a.arrival_place 到货地点, a.product_code 物料组, a.product_name 物料组描述, a.reporting_depart_name 提报单位名称, a.unit 单位, a.demand_count 需求数量, a.amount 金额, b.supplier_name 供应商名称, a.investment_plan_code 投资计划号, b.materia_grade 物资等级, c.name 采购方式名称 from material_china_plan a left join material_china_order b on a.plan_num=b.plan_num and a.plan_row_num=b.plan_row_num left join sys_pur_method c on b.procurement_method_code=c.code left join sys_depart_class d on a.category_code=d.classcode left join material_annual_purchase_detail e on a.material_code=e.material_code left join material_first_level_catalog f on a.material_code=f.material_code left join material_china_plan_distribution g on a.plan_num=g.plan_num and a.plan_row_num=g.plan_row_num where d.rq='2022' and a.full_approval_flag ='已审批通过' AND a.storage_and_sales_agency='否' and a.plan_status_description !='物采系统退回' AND a.plan_status_code != '99' AND a.investment_plan_code IS NULL AND a.demand_list_num IS NULL AND a.submission_date>=('2022') and a.submission_date<=('2023') order by a.category_code asc 仅按照上述sql而言 应该以怎样的一个顺序为a表建立索引,其他表建完了。 |