700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > mysql多表join时候update更新数据办法【MySQL】

mysql多表join时候update更新数据办法【MySQL】

时间:2021-12-07 19:16:58

相关推荐

mysql多表join时候update更新数据办法【MySQL】

数据库|mysql教程

sql语句,update,mysql

数据库-mysql教程

sql语句:

卖手机钓鱼网站源码,VScode能对页面做测试吗,ubuntu-10.10,tomcat部署多节点,web爬虫前端,php编写管理系统,正规的seo官网优化推广lzw

update item i,resource_library r,resource_review_link l set i.name=CONCAT(‘Review:’,r.resource_name) where i.item_id=l.instance_id

and l.level=’item’ and r.resource_id=l.resource_id and i.name=”

奇迹辅助源码,vscode bug插件,ubuntu透明防火墙,tomcat页面打开,sqlite 语句执行记录,组织架构图 js插件,前端pc端框架bgui,土里黄色爬虫图片,php正则url,张家港seo公司,缓存电影网站源码,网页加载等待效果,商城wap模板下载,网站关于我们页面代码,php通用管理系统源码,复利源码程序lzw

JOIN UPDATE & JOIN DELETE

企业首页源码,ubuntu系统屏幕截图,tomcat启动卡主不动了,用爬虫爬取,php会议室预约系统,SEO指的是答案lzw

update a

set a.schoolname = b.schoolname

from tb_Std as a join tb_Sch as b on a.School = b.School

where a.std_year =

go

/*

(2 row(s) affected)

*/

select *

from tb_Std as a join tb_Sch as b on a.School = b.School

/*

A School A A School

2 A A School A A School

3 C A School C C School

4 D D School D D School

(4 row(s) affected)

*/

delete a

from table1 a, table2 b

where a.col1 = b.col1

and a.col2 = b.col2

The above SQL statement runs fine in SQL Server.

If the Oracle 9i has different syntax or if there is any other way to accomplish this with a single delete statement that would be really helpful.

> Hi,

>

> Is the following delete statement possible in Oracle 9i.

>

> delete a

> from table1 a, table2 b

> where a.col1 = b.col1

> and a.col2 = b.col2

>

> The above SQL statement runs fine in SQL Server.

>

> If the Oracle 9i has different syntax or if there is any other way to accomplish this with a single delete statement that would be really helpful.

>

> Thanx in advance.

>

> -Bheem

Bheem,

Try this:

DELETE FROM table1 a where exists (select 1 from table2 b

where a.col1 = b.col1 and a.col2 = b.col2);

Hope this helps,

Tom

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。