且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

规格查找

更新时间:2022-07-18 15:09:05

--库存拉链类规格与规格档案的规格不相同的记录.CSV
select md.mdmodel from model ,
( select f.code as code,s.model as mdmodel from stock s ,mmf f , model m where s.matid=f.matid and substring(f.code,1,1)='Q'
and s.qty>=1 and s.mpsid=''
union
select f.code as code,s.model as mdmodel from stock s ,mmf f , model m where s.matid=f.matid and substring(f.code,1,1)='Q'
and s.qty>=1 and s.mpsid='' ) as md
where model.name!=md.mdmodel
union
select md.mdmodel from model ,
( select f.code as code,s.model as mdmodel from stock s ,mmf f , model m where s.matid=f.matid and substring(f.code,1,1)='Q'
and s.qty>=1 and s.mpsid=''
union
select f.code as code,s.model as mdmodel from stock s ,mmf f , model m where s.matid=f.matid and substring(f.code,1,1)='Q'
and s.qty>=1 and s.mpsid='' ) as md
where model.name!=md.mdmodel

按仓库的需求。