Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Retrieve record with max. date from duplicate records
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00573910
Message ID:
00573934
Vues:
23
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--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform