Practice and Game 테이블에는 존재하지 않는 항목을 찾고 있습니다. 그러나 두 번째 not in 문을 사용할 수 없습니다. 이것을 할 수있는 다른 방법이 있습니까?여러 문장을 사용할 수 없습니다.
select VenueID from Venue
where VenueID not in (select VenueID from Practice)
and not in (select VenueId from Game)
Practice and Game 테이블에는 존재하지 않는 항목을 찾고 있습니다. 그러나 두 번째 not in 문을 사용할 수 없습니다. 이것을 할 수있는 다른 방법이 있습니까?여러 문장을 사용할 수 없습니다.
select VenueID from Venue
where VenueID not in (select VenueID from Practice)
and not in (select VenueId from Game)
당신은 필요 열 이름을 포함하여 NOT IN
문을 반복하십시오.
SELECT VenueID
FROM Venue
WHERE VenueID NOT IN (SELECT VenueID FROM Practice) AND
VenueID NOT IN (SELECT VenueId FROM Game)
^^^ you omitted the second column name
하나의 alterna NOT IN
을 사용하는 것은 두 개의 왼쪽 조인을 수행하는 것입니다.
SELECT VenueID
FROM Venue t1
LEFT JOIN Practice t2
ON t1.VenueID = t2.VenueID
LEFT JOIN Game t3
ON t1.VenueID = t3.VenueID
WHERE t2.VenueID IS NULL AND
t3.VenueID IS NULL
두 번째 not in
에 열 이름을 놓치고 (각 기준은 별도이며, 구문은 설정 < 값>하지>< 열입니다) :
select VenueID from Venue
where VenueID not in (select VenueID from Practice)
and VenueID not in (select VenueId from Game)
-- ^^^^^^^