[ICStockBill] AS [出入库单据表],
(FsupplyID)供应商ID (FItemID)材料ID
[t_Supplier] AS [供应商表] , [t_ICItem] AS [物料表] [t_ICItemCore]([物料表].[FModel]) AS [规格型号],
([物料表].[FFullName]) AS [全名]
以下是查询外购入库与物料与供应商.最后一次送货的单价表
SELECT 物料表.FFullName AS 全名, 物料表.FModel AS 规格型号, 出入库单据分录表.FPrice AS 单价, 供应商表.FName as 供应商 , MAX(出入库单据表.FDate) AS MaxDate
FROM t_ICItem AS 物料表 RIGHT OUTER JOIN ICStockBill AS 出入库单据表 RIGHT OUTER JOIN ICStockBillEntry AS 出入库单据分录表 ON 出入库单据表.FInterID = 出入库单据分录表.FInterID LEFT OUTER JOIN t_Supplier AS 供应商表 ON 出入库单据表.FSupplyID = 供应商表.FItemID ON 物料表.FItemID = 出入库单据分录表.FItemIDGROUP BY 物料表.FFullName, 出入库单据分录表.FEntrySupply, 出入库单据分录表.FPrice, 物料表.FModel, 供应商表.FNameORDER BY 全名, 规格型号