CAST(s.register_capital AS 数字)

时间: 2024-04-01 21:36:54 浏览: 11
这是一条 SQL 语句,用于将字符串类型的 s.register_capital 转换为数字类型。CAST 是 SQL 中的一个函数,用于将一个数据类型转换成另一个数据类型。在这个例子中,s.register_capital 是一个字符串类型的字段,通过 CAST 函数将其转换为数字类型。具体的转换规则取决于所使用的数据库管理系统。
相关问题

SELECT * FROM ( SELECT a.POLICY_NO AS businessNo, a.ENDORSE_SEQ_NO AS businessSerialNo, a.TOTAL_SERIAL_NO AS totalSerialNo, a.BILL_TYPE AS billType, a.ISSUE_COMPANY AS companyCode, a.PLAN_CCY AS currency, a.EXCHANGE_RATE AS exchangeRate, a.PLAN_FEE AS totalAmount, a.VAT AS taxAmount, a.BUSINESS_NO AS proposalNo, CONVERT(decimal(16, 2), round(a.PLAN_FEE * a.EXCHANGE_RATE, 2)) AS exchangeTotalAmount, CONVERT(decimal(16, 2), round(a.VAT * a.EXCHANGE_RATE, 2)) AS exchangeTaxAmount, 'P' AS certiType, (CASE a.VAT WHEN '0' THEN 'N' ELSE 'Y' END) AS taxExemptFlag, a.PAY_NO AS payNo, ( SELECT top 1 g.LOSS_NO FROM GPLOSSFEE g WHERE g.POLICY_NO = a.POLICY_NO) AS lossNo FROM GPPOLICYPLAN a LEFT JOIN ( SELECT t.POLICY_NO, t.BUSINESS_SEQNO, t.PAY_NO, t.FEE_TYPE_CODE, t.TOTAL_SERIAL_NO FROM GPINPUTVATINVOICEREL t, GPPOLICYPLAN b WHERE t.BUSINESS_NO = b.POLICY_NO AND t.BUSINESS_SEQNO = b.ENDORSE_SEQ_NO AND t.PAY_NO = b.PAY_NO AND t.FEE_TYPE_CODE = b.BILL_TYPE AND t.TOTAL_SERIAL_NO = b.TOTAL_SERIAL_NO) p ON a.POLICY_NO = p.POLICY_NO AND a.ENDORSE_SEQ_NO = p.BUSINESS_SEQNO AND a.PAY_NO = p.PAY_NO AND a.BILL_TYPE = p.FEE_TYPE_CODE AND a.TOTAL_SERIAL_NO = p.TOTAL_SERIAL_NO WHERE (a.PAY_NO != p.PAY_NO OR p.PAY_NO IS NULL) AND a.PLAN_FEE < 0 AND a.BILL_TYPE != 'R10' AND a.COMPANY_CODE IN ( '729021' , '729020' , '729023' , '729022' , '729000' , '729061' , '729060' , '729041' , '729040' , '729081' , '729080' , '729079' , '729010' , '729031' , '729078' , '729077' , '729011' , '729050' , '729072' , '729071' , '729074' , '729052' , '729030' , '729051' , '729073' , '729070' , '86' ) ) WHERE rownum <= 5 oracl怎么改写

这个SQL查询语句可以改写为以下形式: ``` SELECT * FROM ( SELECT a.POLICY_NO AS businessNo, a.ENDORSE_SEQ_NO AS businessSerialNo, a.TOTAL_SERIAL_NO AS totalSerialNo, a.BILL_TYPE AS billType, a.ISSUE_COMPANY AS companyCode, a.PLAN_CCY AS currency, a.EXCHANGE_RATE AS exchangeRate, a.PLAN_FEE AS totalAmount, a.VAT AS taxAmount, a.BUSINESS_NO AS proposalNo, CAST(ROUND(a.PLAN_FEE * a.EXCHANGE_RATE, 2) AS DECIMAL(16, 2)) AS exchangeTotalAmount, CAST(ROUND(a.VAT * a.EXCHANGE_RATE, 2) AS DECIMAL(16, 2)) AS exchangeTaxAmount, 'P' AS certiType, CASE a.VAT WHEN '0' THEN 'N' ELSE 'Y' END AS taxExemptFlag, a.PAY_NO AS payNo, ( SELECT TOP 1 g.LOSS_NO FROM GPLOSSFEE g WHERE g.POLICY_NO = a.POLICY_NO ) AS lossNo FROM GPPOLICYPLAN a LEFT JOIN ( SELECT t.POLICY_NO, t.BUSINESS_SEQNO, t.PAY_NO, t.FEE_TYPE_CODE, t.TOTAL_SERIAL_NO FROM GPINPUTVATINVOICEREL t INNER JOIN GPPOLICYPLAN b ON t.BUSINESS_NO = b.POLICY_NO AND t.BUSINESS_SEQNO = b.ENDORSE_SEQ_NO AND t.PAY_NO = b.PAY_NO AND t.FEE_TYPE_CODE = b.BILL_TYPE AND t.TOTAL_SERIAL_NO = b.TOTAL_SERIAL_NO ) p ON a.POLICY_NO = p.POLICY_NO AND a.ENDORSE_SEQ_NO = p.BUSINESS_SEQNO AND a.PAY_NO = p.PAY_NO AND a.BILL_TYPE = p.FEE_TYPE_CODE AND a.TOTAL_SERIAL_NO = p.TOTAL_SERIAL_NO WHERE (a.PAY_NO != p.PAY_NO OR p.PAY_NO IS NULL) AND a.PLAN_FEE < 0 AND a.BILL_TYPE != 'R10' AND a.COMPANY_CODE IN ('729021', '729020', '729023', '729022', '729000', '729061', '729060', '729041', '729040', '729081', '729080', '729079', '729010', '729031', '729078', '729077', '729011', '729050', '729072', '729071', '729074', '729052', '729030', '729051', '729073', '729070', '86') ORDER BY ROWNUM ) WHERE ROWNUM <= 5 ``` 主要的改动包括: - 将转换数据类型的函数 CONVERT 改写为 CAST。 - 将子查询的 TOP 1 改成了 Oracle 中的 ROWNUM。 - 将 LEFT JOIN 改为 INNER JOIN,并将 JOIN 条件移到了 ON 子句中。

insert overwrite table discountdw.dwd_sd_adds_order_bill_inc partition(dt = '2023-06-06') select t1.order_bill_id, t1.counterfoil_no, t1.acceptor, date_format(to_utc_timestamp(cast(t1.expiry_date as bigint) ,'GMT-8'),'YYYY-MM-dd'), t2.company_id, t1.cert_no, t1.company_name, t1.third_order_id, t1.counterfoil_amt/10000, t1.transaction_amt/10000, t1.rate, '3bp' as service_tariffing, ((DATEDIFF(to_utc_timestamp(t1.expiry_date ,'GMT-8'),to_utc_timestamp(t1.transaction_date ,'GMT-8') ) + adjust_days)* 0.0003 *(counterfoil_amt))/ 360 as service_fee, 360 as total_days, DATEDIFF(to_utc_timestamp(t1.expiry_date ,'GMT-8'),to_utc_timestamp(t1.transaction_date ,'GMT-8') ) + adjust_days as modulation_date, t3.channel_type, t3.bank_name, date_format(to_utc_timestamp(cast(t1.transaction_date as bigint) ,'GMT-8'),'YYYY-MM-dd'), t1.order_status_code, t1.order_status_msg, t4.fee_amt, t4.status, t1.tenant_id, t5.revenue, to_utc_timestamp(cast(t1.create_date as bigint) ,'GMT-8'), to_utc_timestamp(cast(t1.update_date as bigint) ,'GMT-8') from (select * from discountdw.ods_adds_order_bill_inc where dt ='2023-06-06' and channel_id=101110004 )t1 left join (select * from mecdw.ods_company_full where platform_id='sdpjw')t2 on t1.cert_no=t2.cert_no and t1.tenant_id=t2.tenant_id left join discountdw.dim_adds_product_full t3 on t1.partner_id=t3.partner_id and t1.product_id=t3.product_id left join (select * from mecdw.dwd_sc_fee_record_full where dt='2023-06-06' and biz_type=2 ) t4 on t1.order_bill_id=t4.third_id left join (select * from discountdw.ods_sd_order_ext_inc where dt='2023-06-06') t5 on t1.order_bill_id=t5.order_bill_id left join sdpjwdw.dim_holiday_info_full t6 on date_format(to_utc_timestamp(t1.expiry_date ,'GMT-8'),'YYYY-MM-dd') = t6.civic_holiday ;

这是一条 SQL 语句,看起来比较长。以下是一些可以考虑优化的建议: 1. 将表名、字段名等缩短,以减少字符数和提高可读性。 2. 将复杂的表连接操作拆分成多个子查询,以降低查询复杂度。 3. 对于一些计算操作,可以考虑使用内置函数或自定义函数,以简化代码并提高可维护性。 4. 对于一些重复的操作,可以将其提取成变量或常量,以减少重复代码。 综上所述,优化后的 SQL 可能类似于以下代码(仅供参考): ``` -- 定义常量 SET adjust_days = 1; -- 查询订单表 WITH order_data AS ( SELECT o.order_bill_id, o.counterfoil_no, o.acceptor, DATE_FORMAT(TO_UTC_TIMESTAMP(CAST(o.expiry_date AS BIGINT), 'GMT-8'), 'YYYY-MM-dd') AS expiry_date, o.cert_no, o.company_name, o.third_order_id, o.counterfoil_amt / 10000 AS counterfoil_amt, o.transaction_amt / 10000 AS transaction_amt, o.rate, '3bp' AS service_tariffing, ((DATEDIFF(TO_UTC_TIMESTAMP(o.expiry_date, 'GMT-8'), TO_UTC_TIMESTAMP(o.transaction_date, 'GMT-8')) + adjust_days) * 0.0003 * (o.counterfoil_amt)) / 360 AS service_fee, 360 AS total_days, DATEDIFF(TO_UTC_TIMESTAMP(o.expiry_date, 'GMT-8'), TO_UTC_TIMESTAMP(o.transaction_date, 'GMT-8')) + adjust_days AS modulation_date, o.order_status_code, o.order_status_msg, o.tenant_id, TO_UTC_TIMESTAMP(CAST(o.create_date AS BIGINT), 'GMT-8') AS create_date, TO_UTC_TIMESTAMP(CAST(o.update_date AS BIGINT), 'GMT-8') AS update_date FROM discountdw.ods_adds_order_bill_inc o WHERE o.dt = '2023-06-06' AND o.channel_id = 101110004 ), -- 查询公司表 company_data AS ( SELECT c.company_id, c.cert_no, c.tenant_id FROM mecdw.ods_company_full c WHERE c.platform_id = 'sdpjw' ), -- 查询产品表 product_data AS ( SELECT p.partner_id, p.product_id, p.channel_type, p.bank_name FROM discountdw.dim_adds_product_full p ), -- 查询费用记录表 fee_data AS ( SELECT f.third_id, f.fee_amt, f.status FROM mecdw.dwd_sc_fee_record_full f WHERE f.dt = '2023-06-06' AND f.biz_type = 2 ), -- 查询订单扩展信息表 order_ext_data AS ( SELECT e.order_bill_id, e.revenue FROM discountdw.ods_sd_order_ext_inc e WHERE e.dt = '2023-06-06' ), -- 查询节假日表 holiday_data AS ( SELECT h.civic_holiday FROM sdpjwdw.dim_holiday_info_full h ) -- 合并数据 INSERT OVERWRITE TABLE discountdw.dwd_sd_adds_order_bill_inc PARTITION(dt = '2023-06-06') SELECT o.order_bill_id, o.counterfoil_no, o.acceptor, o.expiry_date, c.company_id, o.cert_no, o.company_name, o.third_order_id, o.counterfoil_amt, o.transaction_amt, o.rate, o.service_tariffing, o.service_fee, o.total_days, o.modulation_date, p.channel_type, p.bank_name, DATE_FORMAT(TO_UTC_TIMESTAMP(CAST(o.transaction_date AS BIGINT), 'GMT-8'), 'YYYY-MM-dd'), o.order_status_code, o.order_status_msg, f.fee_amt, f.status, o.tenant_id, e.revenue, o.create_date, o.update_date FROM order_data o LEFT JOIN company_data c ON o.cert_no = c.cert_no AND o.tenant_id = c.tenant_id LEFT JOIN product_data p ON o.partner_id = p.partner_id AND o.product_id = p.product_id LEFT JOIN fee_data f ON o.order_bill_id = f.third_id LEFT JOIN order_ext_data e ON o.order_bill_id = e.order_bill_id LEFT JOIN holiday_data h ON o.expiry_date = DATE_FORMAT(TO_UTC_TIMESTAMP(h.civic_holiday, 'GMT-8'), 'YYYY-MM-dd'); ```

相关推荐

为什么下面的sql语句会输出重复的结果:SELECT tp.parent_production_orders AS parent_production_orders, tp.production_orders AS production_orders, tp.work_order AS work_order, tp.contract AS contract, tp.sbbh AS sbbh, tp.batch_num AS batch_num, tp.product_code AS product_code, tp.product_number AS product_number, tp.product_name AS product_name, to_char( middle.create_date, 'yyyy-mm-dd' ) AS issued_date, to_char( to_timestamp( tp.delivery_time / 1000 ), 'yyyy-mm-dd' ) AS delivery_time, middle.line_code AS work_area_code, middle.line_name AS work_area_name, tp.workorder_number AS workorder_number, tp.complete_number AS complete_number, tp.part_unit AS part_unit, middle.work_time_type AS work_time_type, middle.process_time AS process_time, CASE WHEN sc.totalSubmitHours IS NULL THEN 0 ELSE sc.totalSubmitHours END AS submit_work_hours, CASE WHEN middle.process_time > 0 AND sc.totalSubmitHours IS NOT NULL THEN round( ( sc.totalSubmitHours / middle.process_time ), 2 ) * 100 ELSE 0 END plan_achievement_rate, CASE WHEN sc.totalSubmitHours IS NULL THEN 0 ELSE round( CAST ( sc.totalSubmitHours AS NUMERIC ) / CAST ( 60 AS NUMERIC ), 1 ) END AS submit_work_hours_h, round( CAST ( middle.process_time AS NUMERIC ) / CAST ( 60 AS NUMERIC ), 1 ) AS process_time_h, pinfo.material_channel AS material_channel FROM hm_model_work_order_report_middle middle LEFT JOIN hm_model_trc_plan tp ON middle.work_order = tp.work_order LEFT JOIN ( SELECT oro.work_order AS orderNo, oro.work_area_code AS lineCode, SUM ( submit_work_hours ) AS totalSubmitHours, '自制' AS workHourType FROM hm_model_trc_order_report_operation_u orou LEFT JOIN hm_model_trc_order_report_operation oro ON orou.work_order_process_id = oro.ID WHERE orou.work_order_process_id IS NOT NULL AND oro.work_area_code IS NOT NULL GROUP BY oro.work_order, oro.work_area_code UNION all SELECT ohs.work_order_no AS orderNo, ohs.line_code AS lineCode, SUM ( receiving_hour ) AS totalSubmitHours, '外委' AS workHourType FROM hm_model_outsourcing_hour_statistics ohs GROUP BY ohs.work_order_no, ohs.line_code ) sc ON middle.work_order = sc.orderNo AND middle.line_code = sc.lineCode AND middle.work_time_type = sc.workHourType LEFT JOIN hm_model_part_info AS pinfo ON tp.product_number = pinfo.part_code WHERE middle.process_time > 0 AND tp.delivery_time IS NOT NULL AND tp.production_orders LIKE'FJ2023051100286' ORDER BY to_char( to_timestamp( tp.delivery_time / 1000 ), 'yyyy-mm-dd' ) DESC, tp.parent_production_orders DESC, tp.node_level ASC

优化sql:SELECT we.organization_id ,we.wip_entity_id ,case when wl.line_id is null then we.wip_entity_name else '' end wip_entity_name ,we.primary_item_id ,mtt.transaction_type_name ,mmt.transaction_date ,bd.department_code ,mmt.inventory_item_id ,mmt.subinventory_code ,mta.reference_account ,br.resource_code ,lu2.meaning as line_type_name ,mta.base_transaction_value ,mta.cost_element_id ,flv.meaning as cost_element ,wdj.class_code job_type_code ,ml.meaning job_type_name FROM (select * from gerp.mtl_material_transactions where substr(transaction_date,1,7) >= '2023-06' and transaction_source_type_id = 5) mmt inner join gerp.wip_entities we on mmt.organization_id = we.organization_id inner join gerp.mtl_transaction_accounts mta on mta.transaction_source_id = we.wip_entity_id and mta.transaction_id = mmt.transaction_id and mta.transaction_source_type_id = 5 inner join gerp.mtl_transaction_types mtt on mtt.transaction_type_id = mmt.transaction_type_id inner join mfg_lookups lu2 on lu2.lookup_code = mta.accounting_line_type and lu2.lookup_type = 'CST_ACCOUNTING_LINE_TYPE' inner join gerp.mtl_system_items_b msi on msi.inventory_item_id = mmt.inventory_item_id and msi.organization_id = mta.organization_id left join gerp.bom_departments bd on bd.department_id = mmt.department_id left join gerp.bom_resources br on br.resource_id = mta.resource_id left join gerp.wip_lines wl on wl.line_id = mmt.repetitive_line_id left join gerp.wip_discrete_jobs wdj on wdj.wip_entity_id = mta.transaction_source_id left join gerp.fnd_lookup_values_vl flv on cast(mta.cost_element_id as string) = flv.lookup_code and flv.lookup_type = 'CST_COST_CODE_TYPE' left join mfg_lookups ml on ml.lookup_code = wdj.job_type and ml.lookup_type = 'WIP_DISCRETE_JOB' 。其中mmt,we,mta,msi,wdj数据量很大

优化这个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)

TRUNCATE TABLE FDM.fdm_jg_fydkjl; INSERT INTO FDM.fdm_jg_fydkjl ( gh, -- 工号 xm, -- 姓名 dwh, -- 单位号 dwmc, -- 单位名称 fbdkrwsj, -- 发布打卡任务时间 wcdksj, -- 完成打卡时间 dkdd, -- 打卡地点 sfqj, -- 是否请假 sfyxdk, -- 是否有效打卡 xb, -- 性别 lxdh, -- 联系电话 hsqksm, -- 核算情况说明 sfzjh, -- 身份证件号 jzdz -- 居住地址 ) SELECT t2.gh, --工号 t11.xm, --姓名 t11.dwh, -- 单位号 t11.dwmc, -- 单位名称 CAST(NULL AS TIMESTAMP) AS fbdkrwsj, -- 发布打卡任务时间 t2.dksj AS wcdksj, -- 完成打卡时间 NULL AS dkdd, -- 打卡地点 NULL AS sfqj, -- 是否请假 '1' AS sfyxdk, -- 是否有效打卡 CAST(t4.xb AS VARCHAR), --性别 CAST(t7.lxdh AS VARCHAR), -- 联系电话 CAST(t8.hsqksm AS VARCHAR) AS hsqksm, -- 核算情况说明 CAST(t9.sfz AS VARCHAR) AS sfzjh, --身份证件号 CAST(t10.jzdz AS VARCHAR) AS jzdz --居住地址 FROM ( SELECT DISTINCT(t1.user_id) AS gh, t1.answer AS bjmc, t1.answer_time AS dksj FROM ODS.ODS_YDXY_LYYD3_B_GRADUATE_ANSWER t1 WHERE t1.type = 'bjmc' )t2 LEFT JOIN ( SELECT DISTINCT(t1.user_id) AS gh, t1.answer AS xm, t1.answer_time AS dksj FROM ODS.ODS_YDXY_LYYD3_B_GRADUATE_ANSWER t1 WHERE t1.type = 'username' ) t3 ON t2.gh = t3.gh AND t2.dksj = t3.dksj LEFT JOIN ( SELECT DISTINCT(t1.user_id) AS gh, t1.answer AS xb, t1.answer_time AS dksj FROM ODS.ODS_YDXY_LYYD3_B_GRADUATE_ANSWER t1 WHERE t1.type = 'xb' ) t4 ON t2.gh = t4.gh AND t2.dksj = t4.dksj LEFT JOIN ( SELECT DISTINCT(t1.user_id) AS gh, t1.answer AS bjmc, t1.answer_time AS dksj FROM ODS.ODS_YDXY_LYYD3_B_GRADUATE_ANSWER t1 WHERE t1.type = 'bjmc' ) t5 ON t2.gh = t5.gh AND t2.dksj = t5.dksj LEFT JOIN ( SELECT DISTINCT(t1.user_id) AS gh, t1.answer AS bmmc, t1.answer_time AS dksj FROM ODS.ODS_YDXY_LYYD3_B_GRADUATE_ANSWER t1 WHERE t1.type = 'bmmc' ) t6 ON t2.gh = t6.gh AND t2.dksj = t6.dksj LEFT JOIN ( SELECT DISTINCT(t1.user_id) AS gh, CAST(t1.answer AS VARCHAR) AS lxdh, t1.answer_time AS dksj FROM ODS.ODS_YDXY_LYYD3_B_GRADUATE_ANSWER t1 WHERE t1.type = 'bdsjh' ) t7 ON t2.gh = t7.gh AND t2.dksj = t7.dksj LEFT JOIN ( SELECT DISTINCT(t1.user_id) AS gh, t1.answer AS hsqksm, t1.answer_time AS dksj FROM ODS.ODS_YDXY_LYYD3_B_GRADUATE_ANSWER t1 WHERE t1.type = 'radio' ) t8 ON t2.gh = t8.gh AND t2.dksj = t8.dksj LEFT JOIN ( SELECT DISTINCT(t1.user_id) AS gh, t1.answer AS sfz, t1.answer_time AS dksj FROM ODS.ODS_YDXY_LYYD3_B_GRADUATE_ANSWER t1 WHERE t1.type = 'sfz' ) t9 ON t2.gh = t9.gh AND t2.dksj = t9.dksj LEFT JOIN ( SELECT t1.user_id AS gh, t1.answer AS jzdz, t1.answer_time AS dksj FROM ODS.ODS_YDXY_LYYD3_B_GRADUATE_ANSWER t1 WHERE t1.type = 'address' ) t10 ON t2.gh = t10.gh AND t2.dksj = t10.dksj LEFT JOIN FDM.fdm_jg_jbxx t11 ON t2.gh = t11.gh WHERE t2.gh = t11.gh

最新推荐

recommend-type

服务器虚拟化部署方案.doc

服务器、电脑、
recommend-type

北京市东城区人民法院服务器项目.doc

服务器、电脑、
recommend-type

求集合数据的均方差iction-mast开发笔记

求集合数据的均方差
recommend-type

计算机基础知识试题与解答

"计算机基础知识试题及答案-(1).doc" 这篇文档包含了计算机基础知识的多项选择题,涵盖了计算机历史、操作系统、计算机分类、电子器件、计算机系统组成、软件类型、计算机语言、运算速度度量单位、数据存储单位、进制转换以及输入/输出设备等多个方面。 1. 世界上第一台电子数字计算机名为ENIAC(电子数字积分计算器),这是计算机发展史上的一个重要里程碑。 2. 操作系统的作用是控制和管理系统资源的使用,它负责管理计算机硬件和软件资源,提供用户界面,使用户能够高效地使用计算机。 3. 个人计算机(PC)属于微型计算机类别,适合个人使用,具有较高的性价比和灵活性。 4. 当前制造计算机普遍采用的电子器件是超大规模集成电路(VLSI),这使得计算机的处理能力和集成度大大提高。 5. 完整的计算机系统由硬件系统和软件系统两部分组成,硬件包括计算机硬件设备,软件则包括系统软件和应用软件。 6. 计算机软件不仅指计算机程序,还包括相关的文档、数据和程序设计语言。 7. 软件系统通常分为系统软件和应用软件,系统软件如操作系统,应用软件则是用户用于特定任务的软件。 8. 机器语言是计算机可以直接执行的语言,不需要编译,因为它直接对应于硬件指令集。 9. 微机的性能主要由CPU决定,CPU的性能指标包括时钟频率、架构、核心数量等。 10. 运算器是计算机中的一个重要组成部分,主要负责进行算术和逻辑运算。 11. MIPS(Millions of Instructions Per Second)是衡量计算机每秒执行指令数的单位,用于描述计算机的运算速度。 12. 计算机存储数据的最小单位是位(比特,bit),是二进制的基本单位。 13. 一个字节由8个二进制位组成,是计算机中表示基本信息的最小单位。 14. 1MB(兆字节)等于1,048,576字节,这是常见的内存和存储容量单位。 15. 八进制数的范围是0-7,因此317是一个可能的八进制数。 16. 与十进制36.875等值的二进制数是100100.111,其中整数部分36转换为二进制为100100,小数部分0.875转换为二进制为0.111。 17. 逻辑运算中,0+1应该等于1,但选项C错误地给出了0+1=0。 18. 磁盘是一种外存储设备,用于长期存储大量数据,既可读也可写。 这些题目旨在帮助学习者巩固和检验计算机基础知识的理解,涵盖的领域广泛,对于初学者或需要复习基础知识的人来说很有价值。
recommend-type

管理建模和仿真的文件

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

【进阶】音频处理基础:使用Librosa

![【进阶】音频处理基础:使用Librosa](https://picx.zhimg.com/80/v2-a39e5c9bff1d920097341591ca8a2dfe_1440w.webp?source=1def8aca) # 2.1 Librosa库的安装和导入 Librosa库是一个用于音频处理的Python库。要安装Librosa库,请在命令行中输入以下命令: ``` pip install librosa ``` 安装完成后,可以通过以下方式导入Librosa库: ```python import librosa ``` 导入Librosa库后,就可以使用其提供的各种函数
recommend-type

设置ansible 开机自启

Ansible是一个强大的自动化运维工具,它可以用来配置和管理服务器。如果你想要在服务器启动时自动运行Ansible任务,通常会涉及到配置服务或守护进程。以下是使用Ansible设置开机自启的基本步骤: 1. **在主机上安装必要的软件**: 首先确保目标服务器上已经安装了Ansible和SSH(因为Ansible通常是通过SSH执行操作的)。如果需要,可以通过包管理器如apt、yum或zypper安装它们。 2. **编写Ansible playbook**: 创建一个YAML格式的playbook,其中包含`service`模块来管理服务。例如,你可以创建一个名为`setu
recommend-type

计算机基础知识试题与解析

"计算机基础知识试题及答案(二).doc" 这篇文档包含了计算机基础知识的多项选择题,涵盖了操作系统、硬件、数据表示、存储器、程序、病毒、计算机分类、语言等多个方面的知识。 1. 计算机系统由硬件系统和软件系统两部分组成,选项C正确。硬件包括计算机及其外部设备,而软件包括系统软件和应用软件。 2. 十六进制1000转换为十进制是4096,因此选项A正确。十六进制的1000相当于1*16^3 = 4096。 3. ENTER键是回车换行键,用于确认输入或换行,选项B正确。 4. DRAM(Dynamic Random Access Memory)是动态随机存取存储器,选项B正确,它需要周期性刷新来保持数据。 5. Bit是二进制位的简称,是计算机中数据的最小单位,选项A正确。 6. 汉字国标码GB2312-80规定每个汉字用两个字节表示,选项B正确。 7. 微机系统的开机顺序通常是先打开外部设备(如显示器、打印机等),再开启主机,选项D正确。 8. 使用高级语言编写的程序称为源程序,需要经过编译或解释才能执行,选项A正确。 9. 微机病毒是指人为设计的、具有破坏性的小程序,通常通过网络传播,选项D正确。 10. 运算器、控制器及内存的总称是CPU(Central Processing Unit),选项A正确。 11. U盘作为外存储器,断电后存储的信息不会丢失,选项A正确。 12. 财务管理软件属于应用软件,是为特定应用而开发的,选项D正确。 13. 计算机网络的最大好处是实现资源共享,选项C正确。 14. 个人计算机属于微机,选项D正确。 15. 微机唯一能直接识别和处理的语言是机器语言,它是计算机硬件可以直接执行的指令集,选项D正确。 16. 断电会丢失原存信息的存储器是半导体RAM(Random Access Memory),选项A正确。 17. 硬盘连同驱动器是一种外存储器,用于长期存储大量数据,选项B正确。 18. 在内存中,每个基本单位的唯一序号称为地址,选项B正确。 以上是对文档部分内容的详细解释,这些知识对于理解和操作计算机系统至关重要。
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

【基础】网络编程入门:使用HTTP协议

![【基础】网络编程入门:使用HTTP协议](https://img-blog.csdnimg.cn/direct/4fbc6b5a6d744a519429654f56ea988e.png) # 1. 网络编程基础** **1.1 网络基础知识** 网络是连接计算机和设备的系统,允许它们交换数据和资源。它由节点(计算机、服务器、路由器等)和连接它们的数据链路组成。网络可以是局域网(LAN)、广域网(WAN)或互联网。 **1.2 TCP/IP协议栈** TCP/IP协议栈是一组通信协议,用于在网络上传输数据。它分为四层: * **链路层:**处理物理连接和数据传输。 * **网络层: