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:
00494682
Vues:
27
>>See if this works:
>>
>>select fieldlist from mytable where id in (select id, max(effectdate) from mytable group by id)
>
>Thanks for the quick reply Mark. Unfortunately since we're using the IN clause the sub-select would have to be on one value only :(

Well that was dumb of me. How about creating a view in your Oracle DB:

create or replace view someview as select id, max(effectdate) as LastDate from mytable group by id

Then retrieving the records would be quite simple using the subquery.
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform