Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Subqueries in select list of FoxPro SQL
Message
De
03/10/2001 10:47:04
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00563561
Message ID:
00563609
Vues:
18
Thanks for the input Larry. It dawned on me later that I could cook up a workable solution with two queries thusly:

select min(plans.effective) as effective,plans.clientno from plans group by plans.clientno into table nextplan

select rtrim(clients.fname)+rtrim(' '+clients.mname)+' '+rtrim(clients.lname) as fullname, plans.effective, plans.meet_time from clients left outer join nextplan on clients.clientno=nextplan.clientno left outer join plans on clients.clientno=plans.clientno and plans.effective=nextplan.effective

This relies on not having two plans effective the same day. If this couldn't be relied upon, we would need a query in the middle to get the min(plans.meet_time) for each plans.effective.

select min(plans.meet_time) as meet_time, nextplan.effective ,nextplan.clientno from plans join nextplan on nextplan.clientno=plans.clientno and plans.effective=nextplan.effective group by plans.effective, plans.clientno into table nextplan2
Randy Hersom
President, Habilitation Software Inc.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform