更新两个表的记录 [英] Update record of two table

查看:68
本文介绍了更新两个表的记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在表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??


这篇关于更新两个表的记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆