Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
One of the other two INNER JOIN
Message
De
23/04/2015 10:49:06
 
 
À
23/04/2015 09:15:28
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2012
Application:
Web
Divers
Thread ID:
01619007
Message ID:
01619014
Vues:
31
>This would work but I am wondering if there could be something simpler:
>
>
>SELECT Client.Numero
> FROM Client
> LEFT JOIN Invoice ON Invoice.Numero=Client.NoInvoice AND Invoice.SecondCondition=True
> LEFT JOIN Inventory ON Inventory.Numero=Client.NoInventory AND Inventory.SecondCondition=True
> WHERE (EXISTS (SELECT Invoice.Numero FROM Invoice WHERE Invoice.Numero=Client.NoInvoice AND Invoice.SecondCondition=True) OR
>  EXISTS (SELECT Inventory.Numero FROM Inventory WHERE Inventory.Numero=Client.NoInventory AND Inventory.SecondCondition=True))
>
Try this ?
select Client.Numero from Client join Invoice ON Invoice.Numero=Client.NoInvoice AND Invoice.SecondCondition=True 
union 
select Client.Numero from Client join Inventory ON Inventory.Numero=Client.NoInventory AND Inventory.SecondCondition=True 
	
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform