Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Question
Message
From
17/03/1999 12:53:23
 
 
To
16/03/1999 21:00:31
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00197746
Message ID:
00198664
Views:
21
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
Map
View

Click here to load this message in the networking platform