joined table confused
Hi,
I got another 2 table
ENTRY
(name,date_entered,days_allowed,status)
NAME DATE_ENTRY DAYS_ALLOW STATUS
===== ========== ========== =======
SCOTT 01-JAN-07 30
EXIT
(NAME,DATE_EXIT)
NAME DATE_EXIT
===== ========
SCOTT 01-JUL-07
I want to update status = 'OVERSTAY'
if date_exit - date_entry > days_allow
update ENTRY a set a.status='OVERSTAYING'
where a.days_allow< (select b.date_exit - a.date_entry from EXIT b
where a.name = b.name);
Is the above code correct? I hangs up updating 100,000 ENTRY against 100,000 EXIT rows.
Thanks a lot
Behind The Success And Failure Of A Man Is A Woman