Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Understanding SQL Select
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01385138
Message ID:
01385152
Views:
44
Hi Dmitry,

You can use the where condition on the second table and use it as a derived table, e.g.
select * from myTable LEFT JOIN (select * from mySecondTable where ...) mySecond ON ...
BTW, I have a strange feeling we discussed the same problem already with you. Did I dream out about it? Sometimes I have dreams that happen in the real life later...

>Hi,
>
>Here is a pseudo SQL Select statement:
>
>
>select field1, field2, ... from Table1 left join Table2 on Table1.fieldX = Table2.fieldX where (Long Expression)
>
>
>From running this type of SQL Select and analyzing results, it seems to me that VFP will first do the LEFT JOIN and then apply the WHERE condition to the resulting query. Is this correct?
>
>My question is, how do you make the SQL Select to select records from Table1 based on the Long Expression and then LEFT JOIN the resulting query?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform