Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Special INNER JOIN clause required
Message
De
14/03/2009 12:58:14
 
 
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:
01387986
Message ID:
01388071
Vues:
38
>I'm not really sure what you're after . Will this work for you?
>
>SELECT Member.FirstName 
>	FROM Member 
>	WHERE EXISTS (SELECT 1 FROM Friend 
>  		    WHERE Friend.NoMember = Member.NoMember OR Friend.NoMember2 = Member.NoMember)
>		AND Member.NoMember = 1	
>
>
Thanks, the revised version would then be:
SELECT Member.FirstName 
	FROM Member 
	WHERE EXISTS (SELECT 1 FROM Friend 
  		    WHERE Friend.NoMember = Member.Numero OR Friend.NoMember2 = Member.Numero
  		    and (Friend.NoMember=1 or Friend.NoMember2=1))
 AND Member.Numero<>1
where the ID used for the condition would then be the ID of the member I would like to obtain the possible matches in the friend table.
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
Répondre
Fil
Voir

Click here to load this message in the networking platform