Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unsupported subselect type
Message
From
22/02/2008 15:30:05
 
 
To
22/02/2008 15:18:23
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01295494
Message ID:
01295497
Views:
19
Suggestion follows:
*!* Your original SQL
select G.cStyle, G.kGarment, G.cDescrip, G.nDefPrice ;
  from Garments G ;
 where lkLoc in (select LG.kLoc from LocGarment LG ;
                  where LG.kGarment = G.kGarment   )

*!* Proposed Solution
SELECT G.cStyle, G.kGarment, G.cDescrip, G.nDefPrice ;
FROM Garments G ;
     JOIN LocGarment LG ON ;
          LocGarment.kLoc = Garments.lkLoc ;
What you're really doing is limiting Garments by a PK/FK 1:M relation in LocGarment. A simple INNER JOIN between the two will limit Garments to what is also in LocGarment. Am I seeing the problem-solution pair correctly here?
Previous
Reply
Map
View

Click here to load this message in the networking platform