0

我想看看这是否有效:

SELECT TO_CHAR (TutorReport.Month, 'MONTH') MONTH, TutorReport.MatchID, MatchHistory.MatchID, MatchHistory.Tutor.ID
FROM TutorReport, MatchID
WHERE TutorReport.MatchID=MatchHistory.MatchID
AND NOT (TutorReport.Month=‘JULY’);

表:

TutorReport: MatchID、月份、小时、课程

MatchHistory MatchID、TutorID、主题、学生 ID、StartDate EndDate

任何帮助表示赞赏

4

1 回答 1

2

您可以使用加入表格LEFT JOIN

SELECT  a.*
FROM    MatchHistory a
        LEFT JOIN TutorReport b
            ON  a.MatchID = b.MatchID AND
                TO_CHAR(b.Month, 'Month') = 'JULY'
WHERE   b.MatchID IS NULL
于 2013-04-15T00:44:40.187 回答