Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Retrieve record with max. date from duplicate records
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00573910
Message ID:
00573934
Views:
24
Even simplier
SELECT field1, MAX(date) ;
        FROM mytable GROUP BY field1 
>Try
Select field1, date ;
>  FROM mytable ;
>  WHERE field1 + DTOS(date) IN ( ;
>    SELECT field1 + DTOS(MAX(date)) ;
>        FROM mytable GROUP BY field1 )
>
>
>>field1, date
>>campbell,10/01/01
>>campbell,9/8/00
>>cristy,5/1/00
>>cristy,2/2/01
>>
>>I need SQL select statement that will give me only 1 record per field1, but with the latest date:
>>campbell, 10/01/01
>>cristy 2/2/01
>>
>>CAN ANYBODY HELP????
>>Thank you all!!!
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform