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!

Screening rows that are not equal

user1991209Jan 29 2013 — edited Jan 29 2013
The PL/SQL version I am using is 11.1.0.7.0

This is sample data

Id Date Seq Station
__ ____ __ ______
1 3/21/2012 12 1206
1 2/28/2012 24 1712
1 2/12/2012 20 1105

2 3/20/2012 45 1206
2 2/26/2012 46 1206
2 2/22/2012 47 1206

3 3/25/2012 10 1206
3 2/18/2012 12 1105

4 4/21/2012 22 1105
4 4/20/2012 23 1105
4 2/16/2012 24 1105
4 2/16/2012 26 1105

What is required is the highest date for each Id, but only if the station code is the same for all records, otherwise ignore all the records.

The result expected are
Id Date Seq Station
__ ____ __ ______

2 3/20/2012 45 1206
4 4/21/2012 22 1105

Thanks
Paul
This post has been answered by Solomon Yakobson on Jan 29 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 26 2013
Added on Jan 29 2013
4 comments
75 views