Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WHERE IN approach
Message
De
01/03/2017 12:54:20
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2014
OS:
Windows 8.1
Network:
Windows Server 2012
Divers
Thread ID:
01648591
Message ID:
01648683
Vues:
22
>The way your current EXISTS is written doesn't correlate with the parent table, which is wrong. If you want to check for existence of such child for the parent you need to add
>
>and Child.Fk = Parent.PK into your exists test.

Not in that case, I need to verify if a user has particular records in a child table. That will determine if he is allowed to get the parent. In that example, I harded NoMember=1. But, in reality, this would be a parameter, but again, hardcoded for the user who is logged, and not dependant on some data from the parent table. The only corelation which is needed is to assure that records returned from the parent table, has the NoClient value in at least one of the user subscribed forum.
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