I think NEXT_DAY(SYSDATE-6, 'SUN') will work. Assuming that the current day is on Sundays, I return for 6 days (that is, the last Monday), and therefore, when I look for the next Sunday, I will receive sysdate . Whereas next_day(sysdate-8,'SUN') can be used to get the last day of the previous week. Thank you for your efforts.
source share