Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using Select SQL in more than 1 Table
Message
 
À
09/04/2001 23:04:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00493880
Message ID:
00494029
Vues:
17
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform