Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Removing records from a SQL query
Message
 
 
À
21/01/2010 17:04:39
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01445297
Message ID:
01445348
Vues:
16
>>I just re-read your original question again. You don't need to group by ChildPK as in your example (unless it was a complete mock) you seemed to take the first record per Parent Key, not by Parent and ChildKey combined.
>
>When I have more than one child record combinations, I have to take the one with the highest value in the child field. So far, this would work as we would only have two records in a combination, at most, and the one with the highest value would work.

You don't want to GROUP by ChildKey.
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