DELETE tTeacherCourseAccount
FROM tTeacherCourseAccount A
LEFT JOIN
(
SELECT DISTINCT
A.cTeacherUserID
FROM
tCourse_Teacher A
JOIN tCourse B ON A.cCourseID = B.cID
WHERE B.cStartTime BETWEEN @StartDate AND @EndDate
) B ON A.cTeacherID = B.cTeacherUserID
WHERE cStartDate BETWEEN @StartDate AND @EndDate AND B.cTeacherUserID IS NULL
1.上面的deleteSQL语句中,有朋友说delete时,怎么都绕不开排他锁,我认为是正确的。
2.那么在有排他锁的情况下,所有指向相同数据的共享锁都会等待。
第二句话中,就如上面的语句中,被锁定的是那些表?请老哥们帮忙看看,谢谢了
BIG阳
相关分类