CRUD Indictor
kmcharanNov 17 2009 — edited Nov 18 2009Hi,
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