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:24:18
 
 
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:
01500080
Vues:
51
>You can put your condition into JOIN condition or INTO where, the result will be the same.
>
>select M.*, C.* from Master M inner join Child C on M.PK = C.FK and C.SomeField > 0
>
>or
>
>select M.*, C.* from Master M inner join Child C on M.PK = C.FK
>where C.SomeField > 0
>
>If you're talking about LEFT JOIN, then the situation is different and you only can place condition into JOIN condition to get correct results.

I tried that several times and was not able to avoid those records to be part of the result. I tried both approaches as mentioned here. I also tried WHERE primarykey NOT IN () and vice versa.
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