Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

sql - remove duplicate rows based on date column or other column

igweMay 17 2012 — edited May 17 2012
Hello people, is it possible to select the latest row per column for a query:

say my query returns:

book_id, date, price
===========
19,10-JAN-2012,40
19,16-MAY-2012,35
18,10-MAY-2012,21

And I want it to return

book_id, date, price
===========
19,16-MAY-2012,35
18,10-MAY-2012,21

That is, the book_id 19 shows up twice initially but I now return the latest version of it (based on the date column) along with any other rows that do not have duplicates.
Is it possible to do this?
Many Thanks
This post has been answered by Frank Kulash on May 17 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 14 2012
Added on May 17 2012
3 comments
4,540 views