此查询显示正确的结果,但是在执行 EXPLAIN 时,它会将其列为“依赖子查询”,我被认为是错误的?
SELECT Competition.CompetitionID, Competition.CompetitionName, Competition.CompetitionStartDate
FROM Competition
WHERE CompetitionID NOT
IN (
SELECT CompetitionID
FROM PicksPoints
WHERE UserID =1
)
我尝试将查询更改为:
SELECT Competition.CompetitionID, Competition.CompetitionName, Competition.CompetitionStartDate
FROM Competition
LEFT JOIN PicksPoints ON Competition.CompetitionID = PicksPoints.CompetitionID
WHERE UserID =1
and PicksPoints.PicksPointsID is null
但它显示 0 行。与实际有效的第一个查询相比,上述内容有什么问题?