日期:2014-05-17 浏览次数:20934 次
select row_number() over (order by b.applicationmainCode desc) as rowid,
a.applicationdetailid,a.ApplicationMainCode,a.price,a.goodsnum,a.reciveNum,a.sendNum,a.PublicNum,
a.Currency,a.equipment,a.equipmentnum,a.requiredate,a.des,
c.suppliername,d.goodsname,d.standard, d.unit,d.productid,
d.productArea,d.buyarea,e.paymenter,f.workunit,g.classname,
b.Ausername,b.AworkUnit,b.applicationMaindate,b.buycode,UseProuduct,
ProductCode,TSort,TsortChild,TSortNum,
case when tnewflag=1 then '新' else '旧' end as tnewStatus,Tcontent,Tdes,d.price as GPrice ,
case when b.comfigflag=0 then '是' else '否' end as comfigstatus,
(select top 1 getgoodsdate from instock where applicationdetailid=a.applicationdetailid order by getgoodsdate) as getgoodsdate
from Gr_dt_applicationDetail a left join Gr_db_supplier c on a.supplierid=c.supplierid
left join applicationMain b on a.applicationmainCode=b.ApplicationMaincode
left join goods d on a.goodsid=d.goodsid
left join Payment e on b.paymentid=e.paymentid
left join workunit f on b.UworkUnitId=f.workUnit_Id
left join goodstreeclass g on b.classid=g.classid
where a.applicationmainCode=b.ApplicationMaincode and a.goodsid=d.goodsid
and 1=1 and b.passflag>=1
order by b.applicationmainCode desc
SELECT row_number() OVER ( ORDER BY b.applicationmainCode DESC ) AS rowid ,
a.applicationdetailid ,
a.ApplicationMainCode ,
a.price ,
a.goodsnum ,
a.reciveNum ,
a.sendNum ,
a.PublicNum ,
a.Currency ,
a.equipment ,
a.equipmentnum ,
a.requiredate ,
a.des ,