string strSql=@"select h.workshop_code1,a.*,l.*,f.supplier_status,g.ihs_name,k.doc_title,j.et_status,stuff (j.standardfile_path,1,36,'')as standardfile_path ,b.m_name,b.company_name as supplier,b.m_code+a.idnumber as newidnumber,c.hv_code,c.hv_description,c.tech1,c.tech2,c.tech3,c.code1,c.code2,c.code3,d.company_name,e.gl_name from Inn_ET_MachineAssets a
left join (select a.m_id,a.m_name,a.m_code,a.company_id,b.company_name from Inn_ET_MachinesReferenced a left join Inn_Industrial_Company b on a.company_id=b.company_id) b on a.m_id=b.m_id
left join (select a.*,b.processtype_name as tech1,b.processtype_code as code1,
c.processtype_name as tech2,c.processtype_code as code2,d.processtype_name as tech3,d.processtype_code as code3 from Inn_ET_HardwareVersion a
left join Inn_ET_ProcessTech b on a.processtype_id_1=b.processtype_id
left join Inn_ET_ProcessTech c on a.processtype_id_2=c.processtype_id
left join Inn_ET_ProcessTech d on a.processtype_id_3=d.processtype_id) c on a.m_id=c.m_id and a.hv_id=c.hv_id
left join Inn_Industrial_Company d on a.company_id=d.company_id
left join Inn_ET_MachineAssetsMore j on a.et_moreid=j.et_moreid
inner join Inn_ET_MAHistoryDoc l on a.machineasset_id=l.machineasset_id
left join Inn_ET_Equipment_Documents k on l.doc_id=k.doc_id
left join (select gl_id,gl_name from Inn_GemaltoLocations
union all select con_value,con_item from inn_const where con_type=30) e on a.gl_id=e.gl_id
left join Inn_ET_Supplier_status f on c.sp_id=f.sp_id
left join Inn_ET_HardwareVersionStatus g on c.ihs_id=g.ihs_id
left join Inn_ET_MOperations h on a.operation_id=h.operation_id
order by hv_code"; DataTable dataTable = JueKit.Data.DataAccess.ExecuteDatatable(strSql, null, CommandType.Text);
stuff (j.standardfile_path,1,36,'')as standardfile_path 这个加上去怎么不对了?应该怎么写?
left join (select a.m_id,a.m_name,a.m_code,a.company_id,b.company_name from Inn_ET_MachinesReferenced a left join Inn_Industrial_Company b on a.company_id=b.company_id) b on a.m_id=b.m_id
left join (select a.*,b.processtype_name as tech1,b.processtype_code as code1,
c.processtype_name as tech2,c.processtype_code as code2,d.processtype_name as tech3,d.processtype_code as code3 from Inn_ET_HardwareVersion a
left join Inn_ET_ProcessTech b on a.processtype_id_1=b.processtype_id
left join Inn_ET_ProcessTech c on a.processtype_id_2=c.processtype_id
left join Inn_ET_ProcessTech d on a.processtype_id_3=d.processtype_id) c on a.m_id=c.m_id and a.hv_id=c.hv_id
left join Inn_Industrial_Company d on a.company_id=d.company_id
left join Inn_ET_MachineAssetsMore j on a.et_moreid=j.et_moreid
inner join Inn_ET_MAHistoryDoc l on a.machineasset_id=l.machineasset_id
left join Inn_ET_Equipment_Documents k on l.doc_id=k.doc_id
left join (select gl_id,gl_name from Inn_GemaltoLocations
union all select con_value,con_item from inn_const where con_type=30) e on a.gl_id=e.gl_id
left join Inn_ET_Supplier_status f on c.sp_id=f.sp_id
left join Inn_ET_HardwareVersionStatus g on c.ihs_id=g.ihs_id
left join Inn_ET_MOperations h on a.operation_id=h.operation_id
order by hv_code"; DataTable dataTable = JueKit.Data.DataAccess.ExecuteDatatable(strSql, null, CommandType.Text);
stuff (j.standardfile_path,1,36,'')as standardfile_path 这个加上去怎么不对了?应该怎么写?
解决方案 »
- SQL联合查询 怎样将两张表中的相关信息更新第三张表中
- Log Explorer Error
- 为什么我用max函数出错??
- 如果查询是否存在某个数据库用户和某个系统用户
- 安装sqlserver2000时选择的是:本地帐户,装好后如何把sqlserver的帐户改为域帐户,或在sqlserver里添加一个域帐户?
- sql server事务中语句报错后,事务实际状态测试总结,请看看是否正确?
- 关于一个select语句问题
- 修改数据表的某一列(急用!)
- 求sql语句,把两个字段相同的表连在一起,并可以用同一字段排序
- 怪事!怎么有的机子可以查到,有的不行?select * from employees where birthdate like '%1963%'
- 一个查询
- 初学SQL,一个很简单的问题
只知道前面是ID,36个固定的,要把这查询出来的前面的不要,只要后面的
结果:
6789
select stuff ('0123456789012345678901234567890123456789',1,36,'')
6789