Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to subquery in VFP 8
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01046845
Message ID:
01046853
Vues:
16
>Try
SELECT room, MAX(res_date) AS max_date ;
>	FROM mycurs1 ;
>	GROUP BY 1 ;
>	INTO CURSOR crsMaxRes
>*
>SELECT * FROM mycurs1 ;
>	WHERE room + res_date IN ( ;
>		SELECT room + max_date ;
>			FROM crsMaxRes )
>* or
>SELECT mc1.* FROM mycurs1 mc1 ;
>	JOIN crsMaxRes mr ON mr.room = mc1.room ;
>	AND mr.max_date = mc1.res_date
>
>
>

Sergey,

Thank you for your help. I will try what you are suggesting.
I also need to add PK_VALUE column to the resulting cursor and hopefully it won't break the GROUP BY of the SQL Select.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform