General information
Category:
Coding, syntax & commands
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?
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only