我只想从此选择语句中获取前10条记录
SELECT SUM([Order].[Quantity]) As Quantity , [Order].ProductSKU_FK
FROM [Order]
WHERE [Order].[Status] !='Fulfilled'
GROUP BY [Order].[ProductSKU_FK]
ORDER BY Quantity DESC;
答案 0 :(得分:2)
使用TOP
吗?
SELECT TOP 10
SUM([Quantity]) As Quantity,
ProductSKU_FK
FROM [Order]
WHERE [Status] != 'Fulfilled'
GROUP BY ProductSKU_FK
ORDER BY Quantity DESC;