Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Pull Max Record In A Batch
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01415441
Message ID:
01415453
Vues:
32
>>
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform