--库存拉链类规格与规格档案的规格不相同的记录.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
按仓库的需求。