Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SqlDataSource
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Divers
Thread ID:
01238369
Message ID:
01238400
Vues:
6
Select * from Customers Join Stocks on X=Y where Cus_Area = "USA" into Cur1
Select * from Cur1 Join Sales on A= B where Sal_Val > 1000 into Cur2
Select * from Cur2 Join Groups on F=G where Grp_type = "ABC"


Gerard,

I'm not sure I understand why you think that one query is too complex...you're talking about two joins and three criteria conditions.

If you're using SQL 2005, you could investigate common table expressions, which are sort of like temporary views/temporary derived tables. CTEs allow you to construct a query to do some of your filtering, and then perform subsequent filtering of the first result set. They can help "break out" complex queries into one or more parts: but IMO, what you've described is better off in one query (unless that was a subset of it, and there's more to it than just three tables).

Kevin
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform