我需要在单个查询中更新两个表。
请查看以下查询。
Update
m_student_moreinfo
INNER JOIN
m_student
ON
m_student_moreinfo.studentID = m_student.id
SET m_student_moreinfo.MIAStartdate=GETDATE(),m_student.status='Clinical MIA'
where
studentID IN
(
Select
smi.studentID
FROM
dbo.m_student st
INNER JOIN
dbo.m_student_course sc
on
sc.studentID=st.id
INNER JOIN
dbo.m_student_classClinical scl
on
scl.studentcourseID=sc.id
INNER JOIN
dbo.m_student_moreinfo smi
on
smi.studentID=st.id
where
scl.startDate<=GETDATE() and scl.endDate >=GETDATE()
and MIAStartdate IS NULL
)
我在Inner
附近收到了错误的语法。