I need to check (from the same table) if there is an association between two events based on date-time.
One set of data will contain the ending date-time of certain
For same table,
UPDATE PHA_BILL_SEGMENT AS PHA, (SELECT BILL_ID, COUNT(REGISTRATION_NUMBER) AS REG FROM PHA_BILL_SEGMENT GROUP BY REGISTRATION_NUMBER, BILL_DATE, BILL_AMOUNT HAVING REG > 1) T SET PHA.BILL_DATE = PHA.BILL_DATE + 2 WHERE PHA.BILL_ID = T.BILL_ID;