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:
01415447
Vues:
31
>
>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
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform