Information générale
Catégorie:
Codage, syntaxe et commandes
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement