我希望通过标题获得前5个条形码,以显示每个标题出现的最新漫画书(计算结果显示我们已经向拉列表客户和小组出售了多少)... ...目前如果我在SELECT语句中保留TOP 5,它只显示系统中前5位最高的条形码。
对于下面的错误编码我提前抱歉:(提前感谢您好看;)
SELECT TOP 5 tblInventory.barcode, tblInventory.[Issue#], tblInventory.Title, Nz([qryLast_PullList].[SumOfQuantity],0) AS PullList, Nz([qryLast_WalkUp].[SumOfQuantity],0) AS WalkUp, Nz([qryLast_PullList].[SumOfQuantity],0)+Nz([qryLast_WalkUp].[SumOfQuantity],0) AS Total
FROM (tblInventory LEFT JOIN qryLast_PullList ON tblInventory.ID = qryLast_PullList.ID) LEFT JOIN qryLast_WalkUp ON tblInventory.ID = qryLast_WalkUp.ID
GROUP BY tblInventory.barcode, tblInventory.[Issue#], tblInventory.Title, Nz([qryLast_PullList].[SumOfQuantity],0), Nz([qryLast_WalkUp].[SumOfQuantity],0), Nz([qryLast_PullList].[SumOfQuantity],0)+Nz([qryLast_WalkUp].[SumOfQuantity],0)
ORDER BY tblInventory.barcode DESC;