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!

CRUD Indictor

kmcharanNov 17 2009 — edited Nov 18 2009
Hi,

I am trying to determine C(R)UD Indicator for a given row where in a TABLE has columns as CREATED_DATE,UPDATED_DATE,DELETED_DATE.

When I say C(R)UD Indicator I meant the last event occured on that row wheather it has been created, updated, deleted(not interested in read luckily).

Each event will have timestamp in the table.

I need to determine the C(R)UD status by comparing those 3 column values for a given date.

The task looks simpler but I ended up writing complex SQL using CASE expressions and GREATEST, DECODE/SIGN functions. -- (.....may be I my SQL skills are bit rusty???)

Is there any standard pattern you can suggest to know C(R)UD Indicator for a given date.

performance of the SQL query is very important as the concerned TABLE is estimated to have large number of rows as well.

Slight change in table defination is welcomed if it improves the Query performance

Thanks in adavance
Charan
This post has been answered by Brian Camire on Nov 17 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 16 2009
Added on Nov 17 2009
8 comments
294 views