Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
One to many relationship INNER JOIN condition
Message
De
14/02/2011 09:25:19
 
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:
01500073
Message ID:
01500081
Vues:
54
>Could you post some example data and desired result?
>
>I understand your question this way:
>
>SELECT * 
>    FROM MasterTable
>INNER JOIN ChildTable ON MasterTable.PK = ChildTable.FK AND
>                         ChildTable.SomeField1 = ????   AND
>                         ChildTable.SomeField2 = ????
>
>
>BTW this will give you the same results as:
>
>SELECT * 
>    FROM MasterTable
>INNER JOIN ChildTable ON MasterTable.PK = ChildTable.FK
>WHERE ChildTable.SomeField1 = ????   AND
>      ChildTable.SomeField2 = ????
>
>Only if you have LEFT/RIGHT join then it is important where you put the condition.

Yes, this is exactly what I tried at first but was not unable to avoid some records to be part of the SQL result.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform