DISQUS

Eddie Awad’s Blog: Cool Undocumented OVERLAPS Predicate

  • Laurent Schneider · 1 year ago
    WM_OVERLAPS is documented

    SELECT *
    FROM dual
    WHERE WM_OVERLAPS(WM_PERIOD(add_months(sysdate, -6), DATE '2008-08-08'),
    WM_PERIOD(sysdate - 180, sysdate+180))=1;
  • John Flack · 1 year ago
    For many years I have had an OVERLAP_CNT(start_date1 date, end_date1 date, start_date2 date, end_date2 date) function in my CMP package, which is available on my website. This returns a 1 if the date range represented by the first two dates overlaps the date range represented by the second two dates, and a 0 if it does not. This allows you to use it in a sum() to count how many rows have an overlapping date range, or a where clause.
  • Eddie Awad · 1 year ago
    @Laurent: I'm assuming that the WM_OVERLAPS needs the Workspace Manager to be installed/enabled.

    @John: OVERLAP_CNT seems useful. Feel free to share the link to the code on your website.