rofi93

5.2

May 8th, 2021
637
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT EM.ID, EM.MESSAGE_DATE, EM.MESSAGE_FROM, EM.MESSAGE_SUBJECT, EM.MESSAGE_BODY
  2.  FROM (
  3.         (
  4.           SELECT ID
  5.           FROM EMAIL.TO AS TO
  6.           WHERE TO.EMAIL = (
  7.               SELECT P1.EMAIL_ADDRESS
  8.               FROM EMAIL.PERSON AS P1
  9.               WHERE P1.FIRSTNAME = 'Larry' AND P1.LASTNAME = 'May'
  10.           )
  11.         )
  12.         UNION ALL
  13.         (
  14.           SELECT ID
  15.           FROM EMAIL.CC AS CC
  16.           WHERE CC.EMAIL = (
  17.               SELECT P2.EMAIL_ADDRESS
  18.               FROM EMAIL.PERSON AS P2
  19.               WHERE P2.FIRSTNAME = 'Larry' AND P2.LASTNAME = 'May'
  20.           )
  21.         )
  22.   ) AS A
  23. INNER JOIN EMAIL.EMAILS AS EM
  24. ON A.ID = EM.ID AND DATE(EM.MESSAGE_DATE) BETWEEN '2001.09.01' AND '2001.10.31'
  25. ORDER BY EM.MESSAGE_DATE ASC
RAW Paste Data