Skip to content

Instantly share code, notes, and snippets.

@aok1425
Created December 17, 2014 06:54
Show Gist options
  • Save aok1425/8c579d7ff485ef394144 to your computer and use it in GitHub Desktop.
Save aok1425/8c579d7ff485ef394144 to your computer and use it in GitHub Desktop.
SELECT ML.PERSON.MEDRECNO AS MRN, ML.OBS.HDID, ML.OBS.OBSVALUE, ML.OBS.OBSDATE
FROM ML.PERSON INNER JOIN ML.OBS ON ML.PERSON.PID = ML.OBS.PID
WHERE ML.OBS.OBSDATE <= ADD_MONTHS(LAST_DAY(SYSDATE), -1) AND ML.OBS.OBSDATE > ADD_MONTHS(LAST_DAY(SYSDATE), -14) AND ML.OBS.XID = 100000000000000000000000000000000000 AND ML.OBS.CHANGE <10 AND
(ML.OBS.HDID = 2451
OR ML.OBS.HDID = 2753
OR ML.OBS.HDID =18283
OR ML.OBS.HDID = 92
OR ML.OBS.HDID = 6857
OR ML.OBS.HDID = 2323
OR ML.OBS.HDID = 2719
OR ML.OBS.HDID = 27
OR ML.OBS.HDID = 140
OR ML.OBS.HDID = 7046
OR ML.OBS.HDID = 13800195
OR ML.OBS.HDID = 308
OR ML.OBS.HDID = 91
OR ML.OBS.HDID = 7048)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment