Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Include Count Of Records In this Query
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01399490
Message ID:
01399494
Vues:
52
>Ok, so now I have this query
>
>
>
>	SELECT LH.*, Derived.RecordCount 
>		FROM LocationHistory LH 
>		INNER JOIN (SELECT MAX(Sequence) AS Sequence, count(*) as RecordCount, PartID, SerialNo 
>			FROM LocationHistory  
>			GROUP BY PartID, SerialNo ) Derived 
>				ON LH.Sequence = Derived.Sequence and 
>				   LH.PartID = Derived.PartID and 
>				   LH.SerialNo = Derived.SerialNo
>
>
>I want to include as part of the result set a count of all records of each PartId/SerialNo combination

Kevin,

Please see changes inside.
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform