Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
One to many relationship INNER JOIN condition
Message
 
À
14/02/2011 10:20:58
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:
01500105
Vues:
38
>>I'm not sure I'm following you but try
>>WHERE NOT EXISTS (SELECT 1 FROM ManyToManyTable
>> INNER JOIN ChildTable ON ManyToManyTable.NoChildTable=ChildTable.Numero 
>> WHERE Master.Numero=ManyToManyTable.NoMaster
>>   AND ChildTable.Enabled <> 1 )
>>
>
>Thanks, but I still get unwanted master records having some Enabled=0 child records.

You want to get records if ALL child records are Enabled = 0, isn't it?
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform