更新两个表的记录
问题描述:
如何在表A RegNo是主键时更新两个表的记录
和表B RegNo是外键,我想更新A.RegNo = B.RegNo
How to update record of two tables when in Table A RegNo is primary key
and in Table B RegNo is foreign Key and i like to update where A.RegNo=B.RegNo
答
对于我来说,确定从数百种可能性中发布的代码有点过于模糊
你能发布一些样本数据吗?这两个表以及你想要更新的例子。
This is a bit too vague for me to determine what code to post from hundreds of possibilities
Can you post some sample data for the two tables as well as an example of what it is you want to update.
这对我来说有点太模糊了确定从数百种可能性中发布的代码
您可以发布两个表的一些示例数据以及您想要更新的示例。
This is a bit too vague for me to determine what code to post from hundreds of possibilities
Can you post some sample data for the two tables as well as an example of what it is you want to update.
更新学生作为s,学术资格作为集合s.FName =''Maya'',s.LName =''Sharma'',a.InstituteNm =' 'St Joseph'',a .University ='''Barkatullah''其中s.RegNo == a.Regno
update Student as s,AcademicQualification as a set s.FName=''Maya'',s.LName=''Sharma'',a.InstituteNm=''St Joseph'',a.University=''Barkatullah'' where s.RegNo==a.Regno
update Student as s,AcademicQualification as a set s.FName =''Maya'',s.LName =''Sharma'',a.InstituteNm =''St Joseph'',a .University ='''Barkatullah''s where.ReNNo == a.Regno
update Student as s,AcademicQualification as a set s.FName=''Maya'',s.LName=''Sharma'',a.InstituteNm=''St Joseph'',a.University=''Barkatullah'' where s.RegNo==a.Regno
运行上述查询后你得到了什么?
And what did you get after running the above query??