-- 作者:yankunhao
-- 发布时间:2014/7/24 17:31:00
--
我查下语句像如下所示的:
Select {osal_ord1}.sheet_no,delivery_addr,{osal_ord1}.cu_ord_no,pack_mark,pack_mark1,{osal_ord1}.create_date,{osal_ord1}.audit_date,{osal_ord1}.audit_user,{osal_ord1}.rem1,{osal_ord2}.sheet_lot,{osal_ord2}.part_no,sheet_qty,ask_date,affirm_date,{osal_ord2}.rem,{osal_ord2}.define1,{osal_ord2}.define2,{osal_ord2}.define3,国家,客户编码,{obas_part}.item_no,part_name,part_spec,state_name,cust_name,emp_name,user_name,{obas_part1}.part_type,base_name,[wf_zqsxyq],[wf_zqwsyq],[wf_yjzqts],[wf_ys_yssl],{osal_ord1}.[sheet_date],[wf_answer_date],型号规格,[abus_ord_no],[wf_scsh],[wf_wcsl],[wf_ddsd],[wf_sjwsyq],[wf_zqrem],[type_name],CASE WHEN wf_wcsl >= sheet_qty then \'OK\' ELSE \'NO\' END As [装嵌车间计划_状态] From (((((((((({osal_ord2} Inner JOIN {osal_ord1} ON {osal_ord1}.[sheet_no] = {osal_ord2}.[sheet_no]) Inner JOIN {obas_part} ON {obas_part}.[part_no] = {osal_ord2}.[part_no]) Inner JOIN {obas_state} ON {obas_state}.[state_no] = {osal_ord1}.[sheet_sta]) Inner JOIN {obas_cust} ON {obas_cust}.[cust_no] = {osal_ord1}.[cust_no]) Left JOIN {obas_emp} ON {obas_emp}.[emp_no] = {osal_ord1}.[emp_no]) Left JOIN {osys_usergroup} ON {osys_usergroup}.[user_no] = {osal_ord1}.[user_no]) Inner JOIN {obas_part1} ON {obas_part1}.[part_no] = {osal_ord2}.[part_no]) Left JOIN {obas_part_type} ON {obas_part_type}.[type_no] = {obas_part1}.[part_type]) Inner JOIN {料品单位} ON {料品单位}.[base_code] = {osal_ord2}.[sal_unit]) Left JOIN {obas_part_spec} ON {obas_part_spec}.[part_no] = {osal_ord2}.[part_no]) Left JOIN {obas_part_type} ON {obas_part_type}.[type_name] = {obas_part}.[part_name] Where {osal_ord1}.sheet_no is null
|