Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SqlDataSource
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Miscellaneous
Thread ID:
01238369
Message ID:
01238400
Views:
7
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform