Update T_Student
set (PaperType,F_Tif_url,B_Tif_url,Img_url)=
(select
T_Tif.PaperType,
T_Tif.F_FilePath,
T_Tif.B_FilePath,
T_Area.Distribute_dir
from T_Tif,T_Area
where T_Tif.BatchId=:Batch and T_Student.zkzh=T_Tif.zkzh and T_Student.Area_id=T_Area.Area_id);
set (PaperType,F_Tif_url,B_Tif_url,Img_url)=
(select
T_Tif.PaperType,
T_Tif.F_FilePath,
T_Tif.B_FilePath,
T_Area.Distribute_dir
from T_Tif,T_Area
where T_Tif.BatchId=:Batch and T_Student.zkzh=T_Tif.zkzh and T_Student.Area_id=T_Area.Area_id);
更新T_Student表是有条件的,要求T_Student.zkzh=T_Tif.zkzh.
你写的语句有点问题也。
Update T_Student
set (PaperType,F_Tif_url,B_Tif_url,Img_url) =
( select T_Tif.PaperType,
T_Tif.F_FilePath,
T_Tif.B_FilePath,
T_Area.Distribute_dir
from T_Tif,T_Area
where T_Tif.BatchId=:Batch and T_Student.zkzh=T_Tif.zkzh and T_Student.Area_id=T_Area.Area_id )
where exists ( select 1 from T_Tif where T_Student.zkzh=T_Tif.zkzh );