Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Selecting records that have same ID but different date v
Message
General information
Forum:
Oracle
Category:
PL/SQL
Miscellaneous
Thread ID:
00494665
Message ID:
00494682
Views:
26
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform