Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Group by clause in vfp8
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00774269
Message ID:
00774738
Vues:
29
I have always used the group by to get the last physical record in the table and have found that the results have been always been what I expected. I would like to convert my code to play by the VFP8 rules. Does anyone have a good way to get to the same result using proper SQL?

I have a table with attendees and information about the seminar they attended.

Select * from sem order by sem_time desc into cursor sem

Select attd_id, sem_time, sem_loc, sem_cost ;
from sem ;
group by attd_id ;
into cursor sem2

This gives me the information about the last or first seminar of each attendee depending on the order I specify in the first statement.

I would like to continue using only SQL statements, is there a simple solution given the new constraints on Group by?




>
>Pedro,
>In previous version of VFP, if you did not specify a field in the Group By clause, VFP would use the value associated with the record that occured last physically in the table. If you sorted the same table or packed it, you could end up with the same query returning two different results. This was considered to be a bug and was corrected in VFP 8.
>
>If you don't care what values wind up in the extra columns, then don't include them in the query. This will decrease the number of fields you need to add in the Group By clause.
>
>Regards.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform