cnblogs/dcrenl/SQL与Access使用查询结果集更新表.html
2024-09-24 12:43:01 +08:00

18 lines
826 B
HTML

<div id="sina_keyword_ad_area2" class="articalContent ">
<div>SQL语法</div>
<div>update 表1 set 字段1 = bb.字段1 from 表1 as aa,</div>
<div>(select 字段1,字段2 from 表2) bb where aa.字段2 = bb.字段2</div>
<div>&nbsp;</div>
<div>update t1 set t1.字段1= t2.字段1</div>
<div>
<p><em id="__mceDel">from [表1]&nbsp; t1<br />inner join [表2] t2 on t1.字段= t2.字段<br />where t2.字段 = ''</em></p>
</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>Access语法</div>
<div>update&nbsp;<span style="line-height: 21px;">表1&nbsp;</span>as a ,<span style="line-height: 21px;"></span><span style="line-height: 21px;">2</span>&nbsp;as b set
a.<span style="line-height: 21px;">字段1</span>= b.<span style="line-height: 21px;">字段1&nbsp;</span>where
a.StuNo=b.StuNo</div>
</div>
<p>&nbsp;</p>