select distinct top 3 ddate 入库日期,cInvCode 存货编码, iorisum/iQuantity 含税单价 from RdRecords01 left join rdrecord01 on RdRecord01.id=RdRecords01.ID where cInvCode= 'M0000040' and ddate<'2019-04-30 00:00:00.000' order by ddate desc ;
select distinct top 3 ddate 入库日期,cInvCode 存货编码, iorisum/iQuantity 含税单价 from RdRecords01 left join rdrecord01 on RdRecord01.id=RdRecords01.ID where cInvCode= 'M0000118' and ddate<'2019-04-30 00:00:00.000' order by ddate desc ;
select distinct top 3 ddate 入库日期,cInvCode 存货编码, iorisum/iQuantity 含税单价 from RdRecords01 left join rdrecord01 on RdRecord01.id=RdRecords01.ID where cInvCode= 'M0000209' and ddate<'2019-04-30 00:00:00.000' order by ddate desc ;
这种的cInvCode物料编码我有一个表格,我想根据我的物料编码表上的所有物料,查出最后三次的入库价格,上面这样写就是查出的是三个表。怎么能根据物料编码合并到一张表上,并显示价格呢?
慕的地10843
qq_笑_17
相关分类