Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get Max Record
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Divers
Thread ID:
01399249
Message ID:
01399262
Vues:
62
This message has been marked as the solution to the initial question of the thread.
I think in your case max(ActionDate) not equal max(Sequence). Use either one of them, I believe you want max (Sequence), not max(Date).

See changes inside.
>>>select LH.* from LocationHistory LH inner join (select Max(Sequence) as Seq,
>>> PartID, SerialNo from  LocationHistory  group by PartID, SerialNo ) Derived on
>>> LH.Sequence = Derived.Seq and LH.PartID = Derived.PartID and LH.SerialNo = Derived.SerialNo
>
>This is almost there, except I get back rows 2292, 2924, and 2923.
>
>
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