使用单个UPDATE查询更新多个表 [英] Update multiple tables with single UPDATE query

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

问题描述

您好,

我在使用单个值更新多个表时遇到问题..

实际上有3个表名为''imprt'',''imprt2' '和''temp1''。每个表都有相同的字段名''tele''

我必须更新每个表的值...但我的查询不起作用。请问任何一个帮助我?



< tag> UPDATE imprt as a,imprt2 as b,temp1 as c SET a.tele =''d'',b。 tele =''d'',c.telec =''d''WHERE a.telec =''NEHA''和b.tele =''NEHA''和c.tele ='''NEHA''

Hello,
I am having problem to update multiple table with a single value..
Actually have 3 tables named ''imprt'',''imprt2'' and ''temp1''.each table has same field name''tele''
I have to update values of each table...but my query do not work.please can any one help me?

<tag> UPDATE imprt as a,imprt2 as b , temp1 as c SET a.tele = ''d'',b.tele = ''d'',c.telec = ''d'' WHERE a.telec=''NEHA'' AND b.tele=''NEHA'' AND c.tele=''NEHA''

推荐答案

您无法在单个语句中更新多个表。比您可以将所有更新分组到单个语句中过程并在事务中执行该过程,或者您可以批量处理所有更新。
You can not update multiple tables in single statement.Rather than you can group all updates in a single procedure and execute the procedure within transaction or you can batch up all the updates.


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

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