Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00197746
Message ID:
00197809
Vues:
18
If latest means highest numeric sequence field (named Numseqfld), try this:

select Lastname,max(Numseqfld) as Latest from Table1 group by 1 into cursor Cursor1

select Table1.Id,Table1.Lastname,Table1.FirstName from Table1;
Join Cursor1 on Cursor1.Lastname = Table1.Lastname ;
where Table1.numseqfld = Cursor1.Latest

Good Luck

>Dan,
>
>Thanks for the help. The syntax you provided
>worked, but I'v come up with a twist on it:
>
>The table has multiple records for each person.
>I want to pull only the LATEST record of any given
>last name. I have a numeric sequence field that I
>use for ordering.
>
>Will the the syntax you provided still work?
>
>Again, I need Id, Lastname, FirstName but only
>the lastest for each person.
>
>Your thoughts?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform