Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Question
Message
De
17/03/1999 12:53:23
 
 
À
16/03/1999 21:00:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00197746
Message ID:
00198664
Vues:
22
Dan,
I can't seem to get your command to work. VFP complains because it sees the use of the MAX() function as a normal Xbase function used to return the maximum value from the list of provided values (as parameters). Since values are not provided as parameters the error returned is about there being too few arguments. I think what is being attempted is to determine the SQL select of max(sequenceid) which would have to be done as a subquery as in:

select id,lastname,firstname from mytable a ;
where sequenceid in ;
(select max(sequenceid) from mytable b group by lastname)

Am I missing something?
-Dore

>select id, lastname, firstname from mytable ;
>where sequenceid = max(sequenceid) ;
>group by lastname
>
>>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