现在有表
Patient (ID,commid)
Community (commid,streetid)
Street (streetid,branchid)select ID,p.commid,s.streetid,s.branchid from Patient p,Community c,Street s
where p.commid = c.commid and c.streetid = s.streetid;把select出来的ID,p.commid,s.streetid,s.branchid 按照ID update进表
Grant(ID,commid,streetid,branchid)这句Update怎么写?
Patient (ID,commid)
Community (commid,streetid)
Street (streetid,branchid)select ID,p.commid,s.streetid,s.branchid from Patient p,Community c,Street s
where p.commid = c.commid and c.streetid = s.streetid;把select出来的ID,p.commid,s.streetid,s.branchid 按照ID update进表
Grant(ID,commid,streetid,branchid)这句Update怎么写?
from Grant a inner join (
select ID,p.commid,s.streetid,s.branchid
from Community c inner join Patient p on c.commid=p.commid
inner join Street s on c.streetid=s.streetid) t on a.id=t.id
from (select ID,p.commid,s.streetid,s.branchid from Patient p,Community c,Street s
where p.commid = c.commid and c.streetid = s.streetid) A,Grant where Grant.ID = A.ID