Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pull Max Record In A Batch
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01415441
Message ID:
01415453
Views:
34
>>
>>I'm trying to modify this query so that it only looks at the latest record in a batch.
>>
>>
>>SELECT i.*, p.PartNo, p.Description, l.Location, w.WarehouseCode, w.Caption AS Warehouse, w.WarehouseId
>>	FROM Inventory i
>>	JOIN Parts p ON p.PartId = i.PartId
>>	LEFT JOIN Locations l ON l.LocationId = i.LocationId
>>	LEFT JOIN Warehouses w ON w.WarehouseId = i.WarehouseId
>>	WHERE p.PartNo = @PartNo AND
>>		  (@SerialNo IS NULL OR i.SerialNo = @SerialNo) AND
>>		  w.WarehouseId = @WarehouseId AND
>>		  i.LocationId IS NOT NULL AND
>>		  l.RemoveFromInv = 0
>>
>
>What does define the last record in a batch? Is it last by the date?
>
>See
>
>Including an Aggregated Column's Related Values

Yes, the ActionDate column.
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform