SQL Language (MOSC)

MOSC Banner

Query fails to select the earliest time row. Duplicate issue

edited Feb 5, 2019 4:52AM in SQL Language (MOSC) 3 commentsAnswered
0

Hey guys

Hope you can help with something I have been struggling with for a couple of days.

It is about checking duplicate rows after inserted. I know you would say why not checking first before inserting, but we cannot do it for some reasons. We are using Oracle 12c.

When finding more than one same entries (transactionNumber and vendor as unique), the first entry with the earliest time should be passed as 'Success' Status and the other entries with the latest time should be rejected as 'Duplicate' status.

See the below pictures.

This first picture is expected. It happens most of the times in production.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center