我的选择语句没有得到想要的结果。加入似乎正在工作,但我的日期范围内的 WHERE 被完全忽略了。where 语句“WHERE MOPACTIVITY.mopstart BETWEEN sysdate and (sysdate+14)”被完全忽略。有什么想法吗?非常感谢您的专业知识。
尊敬的,乔纳森·晨星
SELECT
MOPACTIVITY.MOPID,
MOPACTIVITY.MOPSERVICEIMPACTED "Type",
MOPACTIVITY.MOPSTATEACTIVITY "State",
MOPACTIVITY.MOPSTATUS "Status",
MOPACTIVITY.MOPSTART "SOM",
MOPACTIVITY.MOPEND "EOM",
MOPACTIVITY.MOPINTRUSIVE "INTRUSIVE",
MOPACTIVITY.MOPDESCRIPTION,
MOPNOTES.MOPNOTEUSER "MN_USER",
MOPNOTES.MOPNOTE "MN_NOTE"
FROM mopuser.MOPACTIVITY INNER JOIN mopuser.mopnotes ON MOPACTIVITY.MOPID = MOPNOTES.MOPID;
SELECT MOPACTIVITY.*, MOPNOTES.* from mopactivity.MOPNOTES where MOPACTIVITY.MOPID = MOPNOTES.MOPID
WHERE MOPACTIVITY.mopstart BETWEEN sysdate and (sysdate+14)
AND MOPACTIVITY.MOPINTRUSIVE = 'true'
AND MOPACTIVITY.mopstatus != 'Complete'
AND MOPACTIVITY.mopstatus != 'Cancelled'
AND (mopactivity.mopid not in (select MOPACTIVITY.mopid from mopuser.mopnotes where
MOPNOTES.MOPNOTEUSER LIKE '%Fortenberry%'
OR MOPNOTES.MOPNOTEUSER LIKE '%Dixon%'
OR MOPNOTES.MOPNOTEUSER LIKE '%Fregoso%'
OR MOPNOTES.MOPNOTEUSER LIKE '%Reices%'
OR MOPNOTES.MOPNOTEUSER LIKE '%Walley%'
OR MOPNOTES.MOPNOTEUSER LIKE '%Lions%'
OR MOPNOTES.MOPNOTEUSER LIKE '%Ramesh%'
OR MOPNOTES.MOPNOTEUSER LIKE '%Saravanan%'
OR MOPNOTES.MOPNOTEUSER LIKE '%Boominathan%'
OR MOPNOTES.MOPNOTEUSER LIKE '%Srinivasan%'
OR MOPNOTES.MOPNOTEUSER LIKE '%Sathya%'
OR MOPNOTES.MOPNOTEUSER LIKE '%Sathish%'
OR MOPNOTES.MOPNOTEUSER LIKE '%Malliga%'
OR MOPNOTES.MOPNOTEUSER LIKE '%Yuvaraj%'
OR MOPNOTES.MOPNOTEUSER LIKE '%Prabhu%'
OR MOPNOTES.MOPNOTEUSER LIKE '%Joseph, Gilbert%'
OR MOPNOTES.MOPNOTEUSER LIKE '%Pradeepa%'
OR MOPNOTES.MOPNOTEUSER LIKE '%Veerababu%'
OR MOPNOTES.MOPNOTEUSER LIKE '%Ramanan%'
OR MOPNOTES.MOPNOTEUSER LIKE '%Rajesh%'
OR MOPNOTES.MOPNOTEUSER LIKE '%Rajan%'
OR MOPNOTES.MOPNOTEUSER LIKE '%Raja%'
OR MOPNOTES.MOPNOTEUSER LIKE '%Vigneshwari%'
OR MOPNOTES.MOPNOTEUSER LIKE '%Govardhan%'
OR MOPNOTES.MOPNOTEUSER LIKE '%Gaytan%'
OR MOPNOTES.MOPNOTEUSER LIKE '%Sheridan%'
OR MOPNOTES.MOPNOTEUSER LIKE '%Goutham'
OR MOPNOTES.MOPNOTEUSER LIKE '%Thennarasu%'
OR MOPNOTES.MOPNOTEUSER LIKE '%Santosh%'
OR MOPNOTES.MOPNOTEUSER LIKE '%Brown, W%'))