Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using Select SQL in more than 1 Table
Message
 
To
09/04/2001 23:04:09
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00493880
Message ID:
00494029
Views:
19
In addition to what Ed suggested, you can also use the following coordinated query to do it all at once:

SELECT ;
address.mno,;
address.ads,;
address.ad1,;
trim(client.sn)+', '+trim(client.fn) as surname ;
FROM ;
address ;
JOIN client on address.mno=client.mno ;
WHERE ;
address.can=0 and ;
address.ads=;
(SELECT MAX(ads) FROM address address2 WHERE address2.mno=address.mno) ;
INTO ;
CURSOR boe

Note the "inner" SELECT on "address" (using an alias of address2) that coordinates with the "address" table in the main query.

These kind of queries can sometimes be kind of slow depending on the amount of data we're talking about, so experiment with this one and doing it in 2 passes as Ed suggested.

--Brad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform