--庫存拉鍊類規格與規格檔案的規格不相同的記錄.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
按倉庫的需求。