惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Cisco Blogs
The Cloudflare Blog
云风的 BLOG
云风的 BLOG
Recorded Future
Recorded Future
F
Fortinet All Blogs
Microsoft Azure Blog
Microsoft Azure Blog
U
Unit 42
博客园 - 三生石上(FineUI控件)
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
N
Netflix TechBlog - Medium
C
Check Point Blog
Security Latest
Security Latest
MongoDB | Blog
MongoDB | Blog
P
Proofpoint News Feed
J
Java Code Geeks
The GitHub Blog
The GitHub Blog
V
Vulnerabilities – Threatpost
阮一峰的网络日志
阮一峰的网络日志
P
Palo Alto Networks Blog
C
CERT Recently Published Vulnerability Notes
F
Full Disclosure
C
Cyber Attacks, Cyber Crime and Cyber Security
雷峰网
雷峰网
T
The Blog of Author Tim Ferriss
T
Threat Research - Cisco Blogs
Cisco Talos Blog
Cisco Talos Blog
V
V2EX
Latest news
Latest news
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
Cyberwarzone
Cyberwarzone
The Hacker News
The Hacker News
A
Arctic Wolf
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
NISL@THU
NISL@THU
腾讯CDC
P
Privacy & Cybersecurity Law Blog
G
GRAHAM CLULEY
罗磊的独立博客
S
Schneier on Security
C
Cybersecurity and Infrastructure Security Agency CISA
博客园 - 司徒正美
K
Kaspersky official blog
L
Lohrmann on Cybersecurity
C
CXSECURITY Database RSS Feed - CXSecurity.com
月光博客
月光博客
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Project Zero
Project Zero
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
I
InfoQ

博客园 - Charles Chen

.Net Framework 4.x 程序到底运行在哪个 CLR 版本之上(ZT) C#常用工具类——Excel操作类(ZT) C#程序以管理员权限运行(ZT) why happen "WaitHandles must be less than or equal to 64" fsn文件解析(C#) MS SQL执行大脚本文件时,提示“内存不足”的解决办法() OLDB读取excel的数据类型不匹配的解决方案(ZT) 加密配置文件(App.Config和Web.config)中connectionStrings通用方法 WinForm中使用XML文件存储用户配置及操作本地Config配置文件(zt) 理解DllImportAttribute中的属性 Winform中消息循环、异步操作、Control.Invoke&Control.BeginInvoke学习 Winform打包程序制作的快捷方式指向错误的位置(指向安装包文件) Reflector导出.NET工程项目的修复 存储过程返回值及输出参数笔记 使用本地系统帐户和域用户帐户两者区别(microsoft SQLServer2000)(ZT) SQL字符串的分组聚合(ZT) C# ComboBox(DropDownList)数据绑定后,怎样再添加选项(ZT) 项目维护之WinXP IIS中HTTP500的来龙去脉 一次项目维护案例而对事务学习的笔记
SQL中使用update inner join和delete inner join (ZT)
Charles Chen · 2012-02-15 · via 博客园 - Charles Chen

    本文转载于SQL中使用update inner join和delete inner join

因项目中在处理数据的时候,需要用到update连接的语句,故需要用到update inner join的语法,这里转载一下,便于以后查找,感谢原作者。

Update XXX set XXX where 这种写法大家肯定都知道,才发现update和delete居然支持inner join的update方式,太神奇了。分享段示例代码:

1

2

3

4

5

update tb_User

set pass=''

from tb_User usr

inner join tb_Address addr on usr.nAddressFK = addr.nAddressID

where usr.id=123

update的格式是

update t1 set t1.name=’Liu’ from t1 inner join t2 on t1.id = t2.tid

delete 语句也是类似

delete from t1 from t1 inner join t2 on t1.id = t2.tid

注意蓝色部分。