Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Selecting records that have same ID but different date v
Message
Information générale
Forum:
Oracle
Catégorie:
PL/SQL
Divers
Thread ID:
00494665
Message ID:
00494669
Vues:
19
>I have a table with say 3 fields--ID, Description, EffectDate. On many records the ID and Description can be the same. The only thing differentiating them is the EffectDate. Out of these duplicates I want only the record with the most recent EffectDate. Is there a way to do this with a SELECT query or am I going to have to loop through a cursor in order to get these results?
>
>TIA,
>George

See if this works:

select fieldlist from mytable where id in (select id, max(effectdate) from mytable group by id)
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform