SQL HAVING SUM GROUP BY
问题 Using SQL Server 2005. I am building an inventory/purchasing program and I’m at the point where I need the user to “check out” equipment. When he selects a product, I need to query which stock locations have the available Qty, and tell the user which location to walk to/ retrieve product. Here is a query for a particular [StockLocation_Products].ProductID, with a particular assigned [ProductUsages].ProductUsageID. SELECT PROD.ProductID, PROD.ProductName, SL.Room, SL.StockSpace, SLPPU.ResvQty,