df = df[(df.vote_count >= 50) &(df.budget * df.revenue * df.popularity * df.vote_average !=0)].reset_index(drop = 'True')

时间: 2024-06-02 19:11:15 浏览: 122
这个代码的意思是筛选出 DataFrame df 中满足以下条件的行: - vote_count 列的值大于等于 50; - budget 列、revenue 列、popularity 列、vote_average 列的乘积不等于 0。 并将满足条件的行重新编号后返回一个新的 DataFrame。其中,reset_index 方法的参数 drop='True' 表示将原来的索引列丢弃,生成新的整数索引列。
相关问题

# Dataloader if webcam: show_vid = check_imshow() cudnn.benchmark = True # set True to speed up constant image size inference dataset = LoadStreams(source, img_size=imgsz, stride=stride) nr_sources = len(dataset.sources) else: dataset = LoadImages(source, img_size=imgsz, stride=stride) nr_sources = 1 vid_path, vid_writer, txt_path = [None] * nr_sources, [None] * nr_sources, [None] * nr_sources # initialize StrongSORT cfg = get_config() cfg.merge_from_file(opt.config_strongsort) # Create as many strong sort instances as there are video sources strongsort_list = [] for i in range(nr_sources): strongsort_list.append( StrongSORT( strong_sort_weights, device, half, max_dist=cfg.STRONGSORT.MAX_DIST, max_iou_distance=cfg.STRONGSORT.MAX_IOU_DISTANCE, max_age=cfg.STRONGSORT.MAX_AGE, n_init=cfg.STRONGSORT.N_INIT, nn_budget=cfg.STRONGSORT.NN_BUDGET, mc_lambda=cfg.STRONGSORT.MC_LAMBDA, ema_alpha=cfg.STRONGSORT.EMA_ALPHA,

这段代码是一个数据加载器(Dataloader)的实现。根据`webcam`变量的取值(True或False),选择不同的数据加载方式。 如果`webcam`为True,则使用`LoadStreams`类加载视频流数据,设置图像大小为`imgsz`,采样间隔为`stride`。同时,通过`check_imshow`函数检查是否可以使用`imshow`函数显示视频。 如果`webcam`为False,则使用`LoadImages`类加载图像数据,设置图像大小为`imgsz`,采样间隔为`stride`。 根据数据加载的方式,确定了数据集的数量`nr_sources`。 接下来,根据配置文件初始化StrongSORT(一种目标跟踪算法)。通过调用`get_config`函数获取配置信息,并将其合并到StrongSORT的配置中。 然后,根据视频源的数量创建相应数量的StrongSORT实例,并将它们存储在`strongsort_list`列表中。每个StrongSORT实例具有不同的参数设置,包括强排序权重、设备类型、是否使用半精度等。 最后,代码中还有一些关于StrongSORT参数的设置,如最大距离、最大IOU距离、最大年龄等等。这些参数可以根据具体需求进行调整。

优化这个sql SELECT count( 1 ) FROM ( SELECT B.ID, B.PURCHASE_REQUEST_ID, B.MATERIAL_ID, B.MATERIAL_CODE, B.MATERIAL_NAME, B.STANDARD, B.MODEL_ID, B.BILL_ROW_ID, B.BILL_NO, BILL_NAME, B.MODEL_CODE, B.MODEL_NAME, B.PARENT_MODEL_ID, B.PARENT_MODEL_CODE, B.PARENT_MODEL_NAME, B.UNIT_CODE, B.UNIT_NAME, B.PURCHASE_TYPE_CODE, CAST( NVL( B.APPLY_NUM, 0 ) AS NUMBER ( 24, 10 ) ) AS APPLY_NUM, CAST( NVL( B.DEAL_NUM, 0 ) AS NUMBER ( 24, 10 ) ) AS DEAL_NUM, CAST( NVL( B.RETURN_NUM, 0 ) AS NUMBER ( 24, 10 ) ) AS RETURN_NUM, B.DEAL_USER_ID, B.DEAL_USER_NAME, CAST( NVL( B.PRICE, 0 ) AS NUMBER ( 24, 10 ) ) AS PRICE, CAST( NVL( B.AMOUNT, 0 ) AS NUMBER ( 24, 10 ) ) AMOUNT, B.IMPLEMENT_CODE, B.IMPLEMENT_NAME, B.IMPLEMENT_INVEST_AMOUNT, B.PURCHASE_MANAGER_ID, B.PURCHASE_MANAGER_NAME, B.PROVIDER_ID, B.PROVIDER_NAME, B.REMARK, B.DELIVER_AREA, B.DELIVER_ADDRESS, B.RECEIVE_PEOPLE, B.RECEIVE_PEOPLE_PHONE, B.ITEM_STATUS, B.COST_CENTER, B.COST_BUDGET_CODE, B.COST_IMPLEMENT_NAME, B.FRAME_CONT_ID, B.FRAME_CONT_CODE, B.FRAME_CONT_NAME, B.DETAIL_CONFIG, B.PURCHASE_CATEGORY_CODE, B.INVOICE_TITLE_CODE, B.INVOICE_SEND_ADDRRSS, B.MATERIAL_REQUEST_ITEM_ID, B.YEAR, B.DELETE_FLAG, B.PROVINCE_CODE, B.REASON, B.PARENT_ITEM_ID, B.FRAME_CONT_ITEM_ID, B.SUB_MATERIAL_REQUEST_ID, B.SUB_MATERIAL_REQUEST_CODE, B.MATERIAL_URL, B.RECOMMEND_PROVIDER_NAMES, C.PURCHASE_REQUEST_CODE, C.PURCHASE_REQUEST_NAME, C.APPLY_TYPE_CODE, C.CREATOR_NAME, C.APPLY_TELEPHONE, C.COMPANY_NAME, C.DEPT_NAME, B.CREATE_TIME, TO_CHAR( B.CREATE_TIME, 'YYYY-MM-DD' ) CREATE_TIME_STR, C.ARRIVE_TIME, C.IS_TO_END, C.MONEY_WAY_CODE, C.OWN, C.APPLY_CATEGORY_CODE, C.manu_Type, C.BILL_ID, MMD.MATERIAL_TYPE_CODE, B.BRANCH_COMPANY_DEAL_USER_ID, B.BRANCH_COMPANY_DEAL_USER_NAME, ( SELECT ORG_NAME FROM ORGANIZATIONS WHERE DELETE_FLAG = '0' AND ORG_CODE = ( SELECT PARENT_COMPANY_NO FROM ORGANIZATIONS WHERE ID = B.MATERIAL_DEPT_ID )) AS MATERIAL_COMPANY_NAME, B.ORIGINAL, B.PROVIDER_PRODUCT_MODEL, B.PROVIDER_PRODUCT_NAME, B.PRODUCT_DESC, B.Back_Flag, CASE WHEN MMD.material_type_code = 'WZ' THEN '1' WHEN MMD.material_type_code = 'FW' THEN '2' ELSE '3' END apply_category_code_item, NVL( C.IS_CARDSYSTEM_REQUEST, '0' ) IS_CARDSYSTEM_REQUEST, B.APPLY_GROUP_AUTHORITES, B.SCIENTIFIC_RESEARCH_ID, B.SCIENTIFIC_RESEARCH_CODE, B.SCIENTIFIC_RESEARCH_NAME, B.PREQUALFY_CODE, nvl( C.IS_QUICK, '0' ) AS IS_QUICK, C.PURCHASE_WAY_CODE, C.PURCHASE_TYPE_CODE PURCHASE_TYPE_CODE_P, C.ORIGINAL_TYPE, C.PURCHASE_REQUEST_BILLS_TYPE, B.IS_FRAME_CONT_MONAD FROM PURCHASE_REQUEST_ITEM B LEFT JOIN PURCHASE_REQUEST C ON B.PURCHASE_REQUEST_ID = C.ID LEFT JOIN MATERIAL_DATA MMD ON MMD.ID = B.MATERIAL_ID AND MMD.DELETE_FLAG = '0' WHERE B.delete_flag = '0' AND B.Item_Status IN ( 1 ) AND NOT EXISTS ( SELECT * FROM purchase_request_item_log pril WHERE B.id = pril.purchase_request_item_id AND pril.lock_status = '1' AND pril.delete_flag = '0' ) AND ( ( c.apply_type_code NOT IN ( '20', '41', '3' ) AND nvl( B.Apply_Num, 0 ) > nvl( B.Deal_Num, 0 )) OR c.apply_type_code IN ( '20', '41', '3' ) ) AND B.Deal_User_Id =: 1 AND C.MONEY_WAY_CODE =: 2 AND C.APPLY_TYPE_CODE =: 3 AND C.PAY_OUT_TYPE_CODE =: 4 AND C.APPLY_CATEGORY_CODE =: 5 AND NVL( C.IS_CARDSYSTEM_REQUEST, '0' ) = : 6 AND NOT EXISTS ( SELECT * FROM purchase_request_item p left join material_province mp ON p.material_id = mp.material_id WHERE p.delete_flag = 0 AND mp.delete_flag = 0 AND mp.material_status = 03 AND mp.org_code = p.province_code AND p.id = B.id ) ORDER BY C.ID, B.ID ASC)

首先,可以将子查询中的所有列名改为别名,这样可以避免重名和提高代码可读性。另外,可以尝试使用 EXISTS 子查询来替换 NOT EXISTS 子查询,因为 EXISTS 子查询的性能通常更好。最后,可以考虑对 WHERE 子句中的多个条件进行逻辑上的分组,以避免出现过于复杂的条件表达式。下面是优化后的 SQL: SELECT COUNT(1) FROM ( SELECT b.ID, b.PURCHASE_REQUEST_ID, b.MATERIAL_ID, b.MATERIAL_CODE, b.MATERIAL_NAME, b.STANDARD, b.MODEL_ID, b.BILL_ROW_ID, b.BILL_NO, b.BILL_NAME, b.MODEL_CODE, b.MODEL_NAME, b.PARENT_MODEL_ID, b.PARENT_MODEL_CODE, b.PARENT_MODEL_NAME, b.UNIT_CODE, b.UNIT_NAME, b.PURCHASE_TYPE_CODE, CAST(NVL(b.APPLY_NUM, 0) AS NUMBER(24, 10)) AS APPLY_NUM, CAST(NVL(b.DEAL_NUM, 0) AS NUMBER(24, 10)) AS DEAL_NUM, CAST(NVL(b.RETURN_NUM, 0) AS NUMBER(24, 10)) AS RETURN_NUM, b.DEAL_USER_ID, b.DEAL_USER_NAME, CAST(NVL(b.PRICE, 0) AS NUMBER(24, 10)) AS PRICE, CAST(NVL(b.AMOUNT, 0) AS NUMBER(24, 10)) AMOUNT, b.IMPLEMENT_CODE, b.IMPLEMENT_NAME, b.IMPLEMENT_INVEST_AMOUNT, b.PURCHASE_MANAGER_ID, b.PURCHASE_MANAGER_NAME, b.PROVIDER_ID, b.PROVIDER_NAME, b.REMARK, b.DELIVER_AREA, b.DELIVER_ADDRESS, b.RECEIVE_PEOPLE, b.RECEIVE_PEOPLE_PHONE, b.ITEM_STATUS, b.COST_CENTER, b.COST_BUDGET_CODE, b.COST_IMPLEMENT_NAME, b.FRAME_CONT_ID, b.FRAME_CONT_CODE, b.FRAME_CONT_NAME, b.DETAIL_CONFIG, b.PURCHASE_CATEGORY_CODE, b.INVOICE_TITLE_CODE, b.INVOICE_SEND_ADDRRSS, b.MATERIAL_REQUEST_ITEM_ID, b.YEAR, b.DELETE_FLAG, b.PROVINCE_CODE, b.REASON, b.PARENT_ITEM_ID, b.FRAME_CONT_ITEM_ID, b.SUB_MATERIAL_REQUEST_ID, b.SUB_MATERIAL_REQUEST_CODE, b.MATERIAL_URL, b.RECOMMEND_PROVIDER_NAMES, c.PURCHASE_REQUEST_CODE, c.PURCHASE_REQUEST_NAME, c.APPLY_TYPE_CODE, c.CREATOR_NAME, c.APPLY_TELEPHONE, c.COMPANY_NAME, c.DEPT_NAME, b.CREATE_TIME, TO_CHAR(b.CREATE_TIME, 'YYYY-MM-DD') CREATE_TIME_STR, c.ARRIVE_TIME, c.IS_TO_END, c.MONEY_WAY_CODE, c.OWN, c.APPLY_CATEGORY_CODE, c.manu_Type, c.BILL_ID, MMD.MATERIAL_TYPE_CODE, b.BRANCH_COMPANY_DEAL_USER_ID, b.BRANCH_COMPANY_DEAL_USER_NAME, (SELECT ORG_NAME FROM ORGANIZATIONS WHERE DELETE_FLAG = '0' AND ORG_CODE = (SELECT PARENT_COMPANY_NO FROM ORGANIZATIONS WHERE ID = b.MATERIAL_DEPT_ID)) AS MATERIAL_COMPANY_NAME, b.ORIGINAL, b.PROVIDER_PRODUCT_MODEL, b.PROVIDER_PRODUCT_NAME, b.PRODUCT_DESC, b.Back_Flag, CASE WHEN MMD.material_type_code = 'WZ' THEN '1' WHEN MMD.material_type_code = 'FW' THEN '2' ELSE '3' END apply_category_code_item, NVL(c.IS_CARDSYSTEM_REQUEST, '0') IS_CARDSYSTEM_REQUEST, b.APPLY_GROUP_AUTHORITES, b.SCIENTIFIC_RESEARCH_ID, b.SCIENTIFIC_RESEARCH_CODE, b.SCIENTIFIC_RESEARCH_NAME, b.PREQUALFY_CODE, NVL(c.IS_QUICK, '0') AS IS_QUICK, c.PURCHASE_WAY_CODE, c.PURCHASE_TYPE_CODE PURCHASE_TYPE_CODE_P, c.ORIGINAL_TYPE, c.PURCHASE_REQUEST_BILLS_TYPE, b.IS_FRAME_CONT_MONAD FROM PURCHASE_REQUEST_ITEM b LEFT JOIN PURCHASE_REQUEST c ON b.PURCHASE_REQUEST_ID = c.ID LEFT JOIN MATERIAL_DATA MMD ON MMD.ID = b.MATERIAL_ID AND MMD.DELETE_FLAG = '0' WHERE b.delete_flag = '0' AND b.Item_Status IN (1) AND b.Deal_User_Id = :1 AND C.MONEY_WAY_CODE = :2 AND C.APPLY_TYPE_CODE = :3 AND C.PAY_OUT_TYPE_CODE = :4 AND C.APPLY_CATEGORY_CODE = :5 AND NVL(C.IS_CARDSYSTEM_REQUEST, '0') = :6 AND EXISTS ( SELECT * FROM purchase_request_item_log pril WHERE B.id = pril.purchase_request_item_id AND pril.lock_status = '1' AND pril.delete_flag = '0' ) AND ( c.apply_type_code IN ('20', '41', '3') OR ( c.apply_type_code NOT IN ('20', '41', '3') AND NVL(b.Apply_Num, 0) > NVL(b.Deal_Num, 0) ) ) AND NOT EXISTS ( SELECT * FROM purchase_request_item p LEFT JOIN material_province mp ON p.material_id = mp.material_id WHERE p.delete_flag = 0 AND mp.delete_flag = 0 AND mp.material_status = 03 AND mp.org_code = p.province_code AND p.id = b.id ) ORDER BY c.ID, b.ID ASC )
阅读全文

相关推荐

改为pgsql select c.* from ( select a.* from ( SELECT t.PROJ_ID,t.PROJ_CODE,t.PROJ_NAME,t.CLIENT_CODE,t.CLIENT_NAME,t.SPEC_CODE,t.SPEC_NAME,t.BUS_UNIT_CODE,t.BUS_UNIT,t.PROJ_DEP_CODE,t.PROJ_DEP,t.PROJECT_MANAGER_CODE,t.PROJECT_MANAGER,t.PROJECT_DEP_MANAGER_CODE,t.PROJECT_DEP_MANAGER,t.IS_SUB_PROJ,t.SUB_PROJ_TYPE_CODE,t.SUB_PROJ_TYPE,t.PARENT_CODE,t.PROJ_GROSS,t.CLIENT_AREA_CODE,t.CLIENT_AREA,t.CLIENT_TYPE_FULL_PATH_CODE,t.CLIENT_TYPE_PULL_PATH,t.BUSINESS_TYPE_CODE,t.BUSINESS_TYPE,t.BUSINESS_LEVEL_CODE,t.BUSINESS_LEVEL,t.BUSINESS_AREA_CODE,t.BUSINESS_AREA_NAME,t.IS_CLOSE,t.IS_IN_COO,t.TAX_RATE,t.IS_AUTHORIZED,t.AUTHORIZED_AMOUNT,t.IS_VIRTUAL,t.INCOME_BUDGET,t.EXPENDITURE_BUDGET,t.P_VALUE,t.CREATE_TIME,t.P_BUD_VALUE,t.P1_BUD_VALUE,t.P2_BUD_VALUE,t.ORG_CODE,t.ORG_NAME,t.PROD_RES_TYPE,t.IS_TECH_COO,t.COO_UNIT_RATIO,t.PROJ_ACHIEVEMENTS_BUD,t.REIMBURSEMENT_COST_BUD,t.COO_COST_BUD,t.MATERIAL_COST_BUD,t.PERFORMANCE_PERCENT,t.SCHE_START_TIME,t.SCHE_END_TIME,t.PROJECT_ACCOUNT_CODE,t.CUSTOMER_TYPE_CODE,t.CUSTOMER_TYPE,t.IS_PURE_OUT_PROJ,t.PROJECT_CREATE_TIME,t.IS_RELATE,t.IS_QUOTA,t.MAIN_PROJECT_CODE,t.PROJ_STATUS,t.IS_LARGE_PROJECT,t.MARKET_DIS_COUNT_RATE,t.PROJECT_CAT,t.MGR_PER_FORMANCE_RATIO,t.P1_VALUE,t.S_VALUE,t.COOP_VALUE,t.H_VALUE,t.DEVICE_BUDGET_COST,t.SUR_FEE_DIS_COUNT_RATE,t.DES_FEE_DIS_COUNT_RATE, (select listagg(p.coo_unit_code, ',') within group(order by p.coo_unit_code) from ( select distinct coo_unit_code from t_spdi_proj where is_sub_proj = 'Y' and sub_proj_type_code = 'wbhz' and PROJ_STATUS != 'P_5' AND PROJ_STATUS != 'P_4' and parent_code = t.proj_code )p ) coo_unit_code, (select listagg(to_char(p.coo_unit), ',') within group(order by p.coo_unit) from ( select distinct coo_unit from t_spdi_proj where is_sub_proj = 'Y' and sub_proj_type_code = 'wbhz' and PROJ_STATUS != 'P_5' AND PROJ_STATUS != 'P_4' and parent_code = t.proj_code )p ) coo_unit from T_SPDI_PROJ t where -- and t.PARENT_CODE=#{parentCode:VARCHAR} t.IS_SUB_PROJ='Y' and t.SUB_PROJ_TYPE_CODE='zz' and t.PROJ_STATUS NOT IN ('E','H','W') order by t.proj_id )a )c

使其简短些 SELECT * FROM ( SELECT fpd.fpd_id AS fpdId, fpd.fpd_budget_project AS fpdBudgetProject, fpd.fpd_budget_project_id AS fpdBudgetProjectId, fpd.fpd_pf_name AS fpdPfName, fpd.fpd_pf_id AS fpdPfId, fpd.fpd_expend_subject AS fpdExpendSubject, fpd.fpd_expend_subject_id AS fpdExpendSubjectId, fpd.fpd_payee_name AS fpdPayeeName, fpd.fpd_payee_account AS fpdPayeeAccount, fpd.fpd_payee_opening_bank AS fpdPayeeOpeningBank, fpd.fpd_payee_opening_bank_num AS fpdPayeeOpeningBankNum, fpd.fpd_dept_pay_economics_classify_num AS fpdDeptPayEconomicsClassifyNum, fpd.fpd_dept_pay_economics_classify_name AS fpdDeptPayEconomicsClassifyName, fpd.fpd_applied_amount AS fpdAppliedAmount, fpd.fpd_capital_use AS fpdCapitalUse, fpd.fpd_postscript AS fpdPostscript, fpd.fpd_budget_item_name AS fpdBudgetItemName, fpd.fpd_budget_item_number AS fpdBudgetItemNumber, fpd.fpd_dr_name AS fpdDrName, dbec.dbec_parent_num AS dbecParentNum FROM financial_payment_details fpd LEFT JOIN dept_budget_economy_class dbec ON fpd.fpd_dept_pay_economics_classify_num = dbec.dbec_num WHERE fpd.fpd_is_tax = "0" UNION ALL SELECT fpd.fpd_id AS fpdId, fpd.fpd_budget_project AS fpdBudgetProject, fpd.fpd_budget_project_id AS fpdBudgetProjectId, fpd.fpd_pf_name AS fpdPfName, fpd.fpd_pf_id AS fpdPfId, fpd.fpd_expend_subject AS fpdExpendSubject, fpd.fpd_expend_subject_id AS fpdExpendSubjectId, fpd.fpd_payee_name AS fpdPayeeName, fpd.fpd_payee_account AS fpdPayeeAccount, fpd.fpd_payee_opening_bank AS fpdPayeeOpeningBank, fpd.fpd_payee_opening_bank_num AS fpdPayeeOpeningBankNum, fpd.fpd_dept_pay_economics_classify_num AS fpdDeptPayEconomicsClassifyNum, fpd.fpd_dept_pay_economics_classify_name AS fpdDeptPayEconomicsClassifyName, sum( fpd.fpd_applied_amount ) AS fpdAppliedAmount, fpd.fpd_capital_use AS fpdCapitalUse, fpd.fpd_postscript AS fpdPostscript, fpd.fpd_budget_item_name AS fpdBudgetItemName, fpd.fpd_budget_item_number AS fpdBudgetItemNumber, fpd.fpd_dr_name AS fpdDrName, dbec.dbec_parent_num AS dbecParentNum FROM financial_payment_details fpd LEFT JOIN dept_budget_economy_class dbec ON fpd.fpd_dept_pay_economics_classify_num = dbec.dbec_num WHERE fpd.fpd_is_tax = "1" GROUP BY fpd_pay_num ) t1

将下面这条sql语句简化一下:SELECT * FROM ( SELECT fpd.fpd_id AS fpdId, fpd.fpd_budget_project AS fpdBudgetProject, fpd.fpd_budget_project_id AS fpdBudgetProjectId, fpd.fpd_pf_name AS fpdPfName, fpd.fpd_pf_id AS fpdPfId, fpd.fpd_expend_subject AS fpdExpendSubject, fpd.fpd_expend_subject_id AS fpdExpendSubjectId, fpd.fpd_payee_name AS fpdPayeeName, fpd.fpd_payee_account AS fpdPayeeAccount, fpd.fpd_payee_opening_bank AS fpdPayeeOpeningBank, fpd.fpd_payee_opening_bank_num AS fpdPayeeOpeningBankNum, fpd.fpd_dept_pay_economics_classify_num AS fpdDeptPayEconomicsClassifyNum, fpd.fpd_dept_pay_economics_classify_name AS fpdDeptPayEconomicsClassifyName, fpd.fpd_applied_amount AS fpdAppliedAmount, fpd.fpd_capital_use AS fpdCapitalUse, fpd.fpd_postscript AS fpdPostscript, fpd.fpd_budget_item_name AS fpdBudgetItemName, fpd.fpd_budget_item_number AS fpdBudgetItemNumber, fpd.fpd_dr_name AS fpdDrName, dbec.dbec_parent_num AS dbecParentNum FROM financial_payment_details fpd LEFT JOIN dept_budget_economy_class dbec ON fpd.fpd_dept_pay_economics_classify_num = dbec.dbec_num WHERE fpd.fpd_is_tax = "0" UNION ALL SELECT fpd.fpd_id AS fpdId, fpd.fpd_budget_project AS fpdBudgetProject, fpd.fpd_budget_project_id AS fpdBudgetProjectId, fpd.fpd_pf_name AS fpdPfName, fpd.fpd_pf_id AS fpdPfId, fpd.fpd_expend_subject AS fpdExpendSubject, fpd.fpd_expend_subject_id AS fpdExpendSubjectId, fpd.fpd_payee_name AS fpdPayeeName, fpd.fpd_payee_account AS fpdPayeeAccount, fpd.fpd_payee_opening_bank AS fpdPayeeOpeningBank, fpd.fpd_payee_opening_bank_num AS fpdPayeeOpeningBankNum, fpd.fpd_dept_pay_economics_classify_num AS fpdDeptPayEconomicsClassifyNum, fpd.fpd_dept_pay_economics_classify_name AS fpdDeptPayEconomicsClassifyName, sum( fpd.fpd_applied_amount ) AS fpdAppliedAmount, fpd.fpd_capital_use AS fpdCapitalUse, fpd.fpd_postscript AS fpdPostscript, fpd.fpd_budget_item_name AS fpdBudgetItemName, fpd.fpd_budget_item_number AS fpdBudgetItemNumber, fpd.fpd_dr_name AS fpdDrName, dbec.dbec_parent_num AS dbecParentNum FROM financial_payment_details fpd LEFT JOIN dept_budget_economy_class dbec ON fpd.fpd_dept_pay_economics_classify_num = dbec.dbec_num WHERE fpd.fpd_is_tax = "1" GROUP BY fpd_pay_num ) t1

将下面这条sql语句简短一些:SELECT * FROM ( SELECT fpd.fpd_id AS fpdId, fpd.fpd_budget_project AS fpdBudgetProject, fpd.fpd_budget_project_id AS fpdBudgetProjectId, fpd.fpd_pf_name AS fpdPfName, fpd.fpd_pf_id AS fpdPfId, fpd.fpd_expend_subject AS fpdExpendSubject, fpd.fpd_expend_subject_id AS fpdExpendSubjectId, fpd.fpd_payee_name AS fpdPayeeName, fpd.fpd_payee_account AS fpdPayeeAccount, fpd.fpd_payee_opening_bank AS fpdPayeeOpeningBank, fpd.fpd_payee_opening_bank_num AS fpdPayeeOpeningBankNum, fpd.fpd_dept_pay_economics_classify_num AS fpdDeptPayEconomicsClassifyNum, fpd.fpd_dept_pay_economics_classify_name AS fpdDeptPayEconomicsClassifyName, fpd.fpd_applied_amount AS fpdAppliedAmount, fpd.fpd_capital_use AS fpdCapitalUse, fpd.fpd_postscript AS fpdPostscript, fpd.fpd_budget_item_name AS fpdBudgetItemName, fpd.fpd_budget_item_number AS fpdBudgetItemNumber, fpd.fpd_dr_name AS fpdDrName, dbec.dbec_parent_num AS dbecParentNum FROM financial_payment_details fpd LEFT JOIN dept_budget_economy_class dbec ON fpd.fpd_dept_pay_economics_classify_num = dbec.dbec_num WHERE fpd.fpd_is_tax = "0" UNION ALL SELECT fpd.fpd_id AS fpdId, fpd.fpd_budget_project AS fpdBudgetProject, fpd.fpd_budget_project_id AS fpdBudgetProjectId, fpd.fpd_pf_name AS fpdPfName, fpd.fpd_pf_id AS fpdPfId, fpd.fpd_expend_subject AS fpdExpendSubject, fpd.fpd_expend_subject_id AS fpdExpendSubjectId, fpd.fpd_payee_name AS fpdPayeeName, fpd.fpd_payee_account AS fpdPayeeAccount, fpd.fpd_payee_opening_bank AS fpdPayeeOpeningBank, fpd.fpd_payee_opening_bank_num AS fpdPayeeOpeningBankNum, fpd.fpd_dept_pay_economics_classify_num AS fpdDeptPayEconomicsClassifyNum, fpd.fpd_dept_pay_economics_classify_name AS fpdDeptPayEconomicsClassifyName, sum( fpd.fpd_applied_amount ) AS fpdAppliedAmount, fpd.fpd_capital_use AS fpdCapitalUse, fpd.fpd_postscript AS fpdPostscript, fpd.fpd_budget_item_name AS fpdBudgetItemName, fpd.fpd_budget_item_number AS fpdBudgetItemNumber, fpd.fpd_dr_name AS fpdDrName, dbec.dbec_parent_num AS dbecParentNum FROM financial_payment_details fpd LEFT JOIN dept_budget_economy_class dbec ON fpd.fpd_dept_pay_economics_classify_num = dbec.dbec_num WHERE fpd.fpd_is_tax = "1" GROUP BY fpd_pay_num ) t1

将下面这条sql语句优化简短一些 :SELECT * FROM ( SELECT fpd.fpd_id AS fpdId, fpd.fpd_budget_project AS fpdBudgetProject, fpd.fpd_budget_project_id AS fpdBudgetProjectId, fpd.fpd_pf_name AS fpdPfName, fpd.fpd_pf_id AS fpdPfId, fpd.fpd_expend_subject AS fpdExpendSubject, fpd.fpd_expend_subject_id AS fpdExpendSubjectId, fpd.fpd_payee_name AS fpdPayeeName, fpd.fpd_payee_account AS fpdPayeeAccount, fpd.fpd_payee_opening_bank AS fpdPayeeOpeningBank, fpd.fpd_payee_opening_bank_num AS fpdPayeeOpeningBankNum, fpd.fpd_dept_pay_economics_classify_num AS fpdDeptPayEconomicsClassifyNum, fpd.fpd_dept_pay_economics_classify_name AS fpdDeptPayEconomicsClassifyName, fpd.fpd_applied_amount AS fpdAppliedAmount, fpd.fpd_capital_use AS fpdCapitalUse, fpd.fpd_postscript AS fpdPostscript, fpd.fpd_budget_item_name AS fpdBudgetItemName, fpd.fpd_budget_item_number AS fpdBudgetItemNumber, fpd.fpd_dr_name AS fpdDrName, dbec.dbec_parent_num AS dbecParentNum FROM financial_payment_details fpd LEFT JOIN dept_budget_economy_class dbec ON fpd.fpd_dept_pay_economics_classify_num = dbec.dbec_num WHERE fpd.fpd_is_tax = "0" UNION ALL SELECT fpd.fpd_id AS fpdId, fpd.fpd_budget_project AS fpdBudgetProject, fpd.fpd_budget_project_id AS fpdBudgetProjectId, fpd.fpd_pf_name AS fpdPfName, fpd.fpd_pf_id AS fpdPfId, fpd.fpd_expend_subject AS fpdExpendSubject, fpd.fpd_expend_subject_id AS fpdExpendSubjectId, fpd.fpd_payee_name AS fpdPayeeName, fpd.fpd_payee_account AS fpdPayeeAccount, fpd.fpd_payee_opening_bank AS fpdPayeeOpeningBank, fpd.fpd_payee_opening_bank_num AS fpdPayeeOpeningBankNum, fpd.fpd_dept_pay_economics_classify_num AS fpdDeptPayEconomicsClassifyNum, fpd.fpd_dept_pay_economics_classify_name AS fpdDeptPayEconomicsClassifyName, sum( fpd.fpd_applied_amount ) AS fpdAppliedAmount, fpd.fpd_capital_use AS fpdCapitalUse, fpd.fpd_postscript AS fpdPostscript, fpd.fpd_budget_item_name AS fpdBudgetItemName, fpd.fpd_budget_item_number AS fpdBudgetItemNumber, fpd.fpd_dr_name AS fpdDrName, dbec.dbec_parent_num AS dbecParentNum FROM financial_payment_details fpd LEFT JOIN dept_budget_economy_class dbec ON fpd.fpd_dept_pay_economics_classify_num = dbec.dbec_num WHERE fpd.fpd_is_tax = "1" GROUP BY fpd_pay_num ) t1

pdf

最新推荐

recommend-type

英语四级高频单词、词组、短语.pdf

10. budget:预算,财务管理中的重要概念。 11. candidate:候选人,适用于选举或应聘职位。 12. transform:转变,变化,指事物的根本性变化。 13. transmit:传播,传输,如信息或疾病传播。 14. transplant:移植...
recommend-type

SL-ST 差速器3D模型 SL-ST 差速器

SL_ST 差速器
recommend-type

C#大型药品进销存管理系统源码数据库 Access源码类型 WinForm

C#大型药品进销存管理系统源码 一、源码特点 采用典型的三层架构进行开发,实现药品管理的功能,功能齐全,非常强大,是一套完整源码 二、菜单功能 工具栏功能包括: 1、审核入库 2、审核出库 3、零售收银 4、调拨申请 5、视频对话 6、药监数据 7、重新登录 8、计算器 9、记事本 10、退出 菜单栏功能包括: 1、采购管理 2、销售管理 3、库存管理 4、综合统计 5、门店配送管理 6、门店零售管理 7、药监管理 8、基本信息维护 9、系统涉资 10、系统管理 11、统计分析 12、奖项管理 三、注意事项 开发环境为Visual Studio 2010,数据库为Access,使用.net 4.0开发。
recommend-type

C语言数组操作:高度检查器编程实践

资源摘要信息: "C语言编程题之数组操作高度检查器" C语言是一种广泛使用的编程语言,它以其强大的功能和对低级操作的控制而闻名。数组是C语言中一种基本的数据结构,用于存储相同类型数据的集合。数组操作包括创建、初始化、访问和修改元素以及数组的其他高级操作,如排序、搜索和删除。本资源名为“c语言编程题之数组操作高度检查器.zip”,它很可能是一个围绕数组操作的编程实践,具体而言是设计一个程序来检查数组中元素的高度。在这个上下文中,“高度”可能是对数组中元素值的一个比喻,或者特定于某个应用场景下的一个术语。 知识点1:C语言基础 C语言编程题之数组操作高度检查器涉及到了C语言的基础知识点。它要求学习者对C语言的数据类型、变量声明、表达式、控制结构(如if、else、switch、循环控制等)有清晰的理解。此外,还需要掌握C语言的标准库函数使用,这些函数是处理数组和其他数据结构不可或缺的部分。 知识点2:数组的基本概念 数组是C语言中用于存储多个相同类型数据的结构。它提供了通过索引来访问和修改各个元素的方式。数组的大小在声明时固定,之后不可更改。理解数组的这些基本特性对于编写有效的数组操作程序至关重要。 知识点3:数组的创建与初始化 在C语言中,创建数组时需要指定数组的类型和大小。例如,创建一个整型数组可以使用int arr[10];语句。数组初始化可以在声明时进行,也可以在之后使用循环或单独的赋值语句进行。初始化对于定义检查器程序的初始状态非常重要。 知识点4:数组元素的访问与修改 通过使用数组索引(下标),可以访问数组中特定位置的元素。在C语言中,数组索引从0开始。修改数组元素则涉及到了将新值赋给特定索引位置的操作。在编写数组操作程序时,需要频繁地使用这些操作来实现功能。 知识点5:数组高级操作 除了基本的访问和修改之外,数组的高级操作包括排序、搜索和删除。这些操作在很多实际应用中都有广泛用途。例如,检查器程序可能需要对数组中的元素进行排序,以便于进行高度检查。搜索功能用于查找特定值的元素,而删除操作则用于移除数组中的元素。 知识点6:编程实践与问题解决 标题中提到的“高度检查器”暗示了一个具体的应用场景,可能涉及到对数组中元素的某种度量或标准进行判断。编写这样的程序不仅需要对数组操作有深入的理解,还需要将这些操作应用于解决实际问题。这要求编程者具备良好的逻辑思维能力和问题分析能力。 总结:本资源"c语言编程题之数组操作高度检查器.zip"是一个关于C语言数组操作的实际应用示例,它结合了编程实践和问题解决的综合知识点。通过实现一个针对数组元素“高度”检查的程序,学习者可以加深对数组基础、数组操作以及C语言编程技巧的理解。这种类型的编程题目对于提高编程能力和逻辑思维能力都有显著的帮助。
recommend-type

管理建模和仿真的文件

管理Boualem Benatallah引用此版本:布阿利姆·贝纳塔拉。管理建模和仿真。约瑟夫-傅立叶大学-格勒诺布尔第一大学,1996年。法语。NNT:电话:00345357HAL ID:电话:00345357https://theses.hal.science/tel-003453572008年12月9日提交HAL是一个多学科的开放存取档案馆,用于存放和传播科学研究论文,无论它们是否被公开。论文可以来自法国或国外的教学和研究机构,也可以来自公共或私人研究中心。L’archive ouverte pluridisciplinaire
recommend-type

【KUKA系统变量进阶】:揭秘从理论到实践的5大关键技巧

![【KUKA系统变量进阶】:揭秘从理论到实践的5大关键技巧](https://giecdn.blob.core.windows.net/fileuploads/image/2022/11/17/kuka-visual-robot-guide.jpg) 参考资源链接:[KUKA机器人系统变量手册(KSS 8.6 中文版):深入解析与应用](https://wenku.csdn.net/doc/p36po06uv7?spm=1055.2635.3001.10343) # 1. KUKA系统变量的理论基础 ## 理解系统变量的基本概念 KUKA系统变量是机器人控制系统中的一个核心概念,它允许
recommend-type

如何使用Python编程语言创建一个具有动态爱心图案作为背景并添加文字'天天开心(高级版)'的图形界面?

要在Python中创建一个带动态爱心图案和文字的图形界面,可以结合使用Tkinter库(用于窗口和基本GUI元素)以及PIL(Python Imaging Library)处理图像。这里是一个简化的例子,假设你已经安装了这两个库: 首先,安装必要的库: ```bash pip install tk pip install pillow ``` 然后,你可以尝试这个高级版的Python代码: ```python import tkinter as tk from PIL import Image, ImageTk def draw_heart(canvas): heart = I
recommend-type

基于Swift开发的嘉定单车LBS iOS应用项目解析

资源摘要信息:"嘉定单车汇(IOS app).zip" 从标题和描述中,我们可以得知这个压缩包文件包含的是一套基于iOS平台的移动应用程序的开发成果。这个应用是由一群来自同济大学软件工程专业的学生完成的,其核心功能是利用位置服务(LBS)技术,面向iOS用户开发的单车共享服务应用。接下来将详细介绍所涉及的关键知识点。 首先,提到的iOS平台意味着应用是为苹果公司的移动设备如iPhone、iPad等设计和开发的。iOS是苹果公司专有的操作系统,与之相对应的是Android系统,另一个主要的移动操作系统平台。iOS应用通常是用Swift语言或Objective-C(OC)编写的,这在标签中也得到了印证。 Swift是苹果公司在2014年推出的一种新的编程语言,用于开发iOS和macOS应用程序。Swift的设计目标是与Objective-C并存,并最终取代后者。Swift语言拥有现代编程语言的特性,包括类型安全、内存安全、简化的语法和强大的表达能力。因此,如果一个项目是使用Swift开发的,那么它应该会利用到这些特性。 Objective-C是苹果公司早前主要的编程语言,用于开发iOS和macOS应用程序。尽管Swift现在是主要的开发语言,但仍然有许多现存项目和开发者在使用Objective-C。Objective-C语言集成了C语言与Smalltalk风格的消息传递机制,因此它通常被认为是一种面向对象的编程语言。 LBS(Location-Based Services,位置服务)是基于位置信息的服务。LBS可以用来为用户提供地理定位相关的信息服务,例如导航、社交网络签到、交通信息、天气预报等。本项目中的LBS功能可能包括定位用户位置、查找附近的单车、计算骑行路线等功能。 从文件名称列表来看,包含的三个文件分别是: 1. ios期末项目文档.docx:这份文档可能是对整个iOS项目的设计思路、开发过程、实现的功能以及遇到的问题和解决方案等进行的详细描述。对于理解项目的背景、目标和实施细节至关重要。 2. 移动应用开发项目期末答辩.pptx:这份PPT文件应该是为项目答辩准备的演示文稿,里面可能包括项目的概览、核心功能演示、项目亮点以及团队成员介绍等。这可以作为了解项目的一个快速入门方式,尤其是对项目的核心价值和技术难点有直观的认识。 3. LBS-ofo期末项目源码.zip:这是项目的源代码压缩包,包含了完成单车汇项目所需的全部Swift或Objective-C代码。源码对于理解项目背后的逻辑和实现细节至关重要,同时也是评估项目质量、学习最佳实践、复用或扩展功能的基础。 综合上述信息,"嘉定单车汇(IOS app).zip"不仅仅是一个应用程序的压缩包,它还代表了一个团队在软件工程项目中的完整工作流程,包含了项目文档、演示材料和实际编码,为学习和评估提供了一个很好的案例。
recommend-type

"互动学习:行动中的多样性与论文攻读经历"

多样性她- 事实上SCI NCES你的时间表ECOLEDO C Tora SC和NCESPOUR l’Ingén学习互动,互动学习以行动为中心的强化学习学会互动,互动学习,以行动为中心的强化学习计算机科学博士论文于2021年9月28日在Villeneuve d'Asq公开支持马修·瑟林评审团主席法布里斯·勒菲弗尔阿维尼翁大学教授论文指导奥利维尔·皮耶昆谷歌研究教授:智囊团论文联合主任菲利普·普雷教授,大学。里尔/CRISTAL/因里亚报告员奥利维耶·西格德索邦大学报告员卢多维奇·德诺耶教授,Facebook /索邦大学审查员越南圣迈IMT Atlantic高级讲师邀请弗洛里安·斯特鲁布博士,Deepmind对于那些及时看到自己错误的人...3谢谢你首先,我要感谢我的两位博士生导师Olivier和Philippe。奥利维尔,"站在巨人的肩膀上"这句话对你来说完全有意义了。从科学上讲,你知道在这篇论文的(许多)错误中,你是我可以依
recommend-type

PROTEUS符号定制指南:个性化元件创建与修改的全面攻略

![PROTEUS符号定制指南:个性化元件创建与修改的全面攻略](https://circuits-diy.com/wp-content/uploads/2020/05/74LS00-pinout.png) 参考资源链接:[Proteus电子元件符号大全:从二极管到场效应管](https://wenku.csdn.net/doc/1fahxsg8um?spm=1055.2635.3001.10343) # 1. PROTEUS符号定制基础知识 PROTEUS符号定制是电子工程设计中不可或缺的一环,它允许设计者创建和修改电路元件符号,以符合特定的设计需求。本章将为你提供关于PROTEUS符号