【问题标题】:I have two tables I would like to update from table A to table B . Fills in the blanks according between condition ID我有两个表我想从表 A 更新到表 B 。根据条件ID填空
【发布时间】:2019-09-27 17:39:46
【问题描述】:

我有两张表我想从表 A 更新到表 B。根据条件 ID 填空。

表一

ID  color

1   red
2   
3   
4   
5   blue
6   
7   white
8   
9   
10  
11  
12  yellow
13  
14
15
16
17
18  

表b

color   from   to  
blue      5     6  
red       1     4  
white     7    11  
yellow   12    18  

【问题讨论】:

    标签: ms-access


    【解决方案1】:

    您可以使用带有计算标准的连接来解决此问题,例如:

    update t1 inner join t2 on (t1.id between t2.from and t2.to) set t1.color = t2.color
    

    这与this recent question非常相似。

    【讨论】:

      猜你喜欢
      • 2013-11-10
      • 1970-01-01
      • 2019-02-14
      • 2017-08-08
      • 1970-01-01
      • 2013-01-21
      • 1970-01-01
      • 2023-01-25
      • 2018-04-19
      相关资源
      最近更新 更多