Hi,This might be a simple problem but not sure how to tackle. I have the following query :select distinct AS3.sibref,auth_stat_code,AS3.sdate,AS3.edatefrom AuthStat_History3 AS3where reg_sibref IS NULLand AS3.sibref IN(select sibreffrom AuthStat_History3 AS3where reg_sibref IS NULLgroup by AS3.sibrefhaving count(AS3.sibref) > 4)order by AS3.sibref,AS3.sdate ASCThis gives the following resultssibref auth_code sdate edate-------------------------------------------------------------142289 RD 1996-12-17 NULL142289 AM 2001-12-01 NULL142289 C 2002-10-23 NULL142289 RV 2002-10-23 NULL142289 AM 2002-10-23 NULLi want to be able to update the edate so that the minimum edate row has the sdate of the next record. The result would besibref auth_code sdate edate-------------------------------------------------------------142289 RD 1996-12-17 2001-12-01142289 AM 2001-12-01 2002-10-23142289 C 2002-10-23 2002-10-23142289 RV 2002-10-23 2002-10-23142289 AM 2002-10-23 NULL
I want to be able to write a query which does this without the use of cursors as performance may become an issueChet