怎样Update
测试数据
create table tmpA (id int,TestID int,TestTypeID int,unitID int,Time1 datetime,Time2 datetime)
create table tmpB (id int,unitID int,TestTypeID int,Time1 datetime)
insert tmpA
select 980,6,9476210,1365917,'2013-08-10 13:45:25.027',NULL
union
select 981,6,9513833,1365917,'2013-08-15 08:50:41.020',NULL
union
select 982,6,9546296,1365917,'2013-08-20 01:41:49.550',NULL
...
insert tmpB
select 9533115,1365917,6,'2013-08-18 01:04:44.187'
union
select 9557041,1365917,6,'2013-08-21 05:00:37.907'
...
其中, tmpA.TestID = tmpB.ID, TestTypeID,unitID相同,就是想把A 最后两条Time2的时间update成B的最后两条时间
有很多UnitID,两张表的数量不一样,只想把最后tmpB的行数替换A相应的行
create table tmpA (id int,TestID int,TestTypeID int,unitID int,Time1 datetime,Time2 datetime)
create table tmpB (id int,unitID int,TestTypeID int,Time1 datetime)
insert tmpA
select 980,6,9476210,1365917,'2013-08-10 13:45:25.027',NULL
union
select 981,6,9513833,1365917,'2013-08-15 08:50:41.020',NULL
union
select 982,6,9546296,1365917,'2013-08-20 01:41:49.550',NULL
...
insert tmpB
select 9533115,1365917,6,'2013-08-18 01:04:44.187'
union
select 9557041,1365917,6,'2013-08-21 05:00:37.907'
...
其中, tmpA.TestID = tmpB.ID, TestTypeID,unitID相同,就是想把A 最后两条Time2的时间update成B的最后两条时间
有很多UnitID,两张表的数量不一样,只想把最后tmpB的行数替换A相应的行
...全文
相关推荐
SQL UPDATE 语句
SQL UPDATE 语句 UPDATE 语句用于更新表中的记录。 SQL UPDATE 语句 UPDATE 语句用于更新表中已存在的记录。 SQL UPDATE 语法 UPDATE table_name SET column1=value1,column2=value2,… WHERE some_column=some_value; 请注意 SQL UPDATE 语句中的 WHERE 子句! WHERE 子句规定哪条记录或者哪些记录需要更新。如果您省略了 WHERE 子句,所有的记录都将被更新! 演示数据库 在本教程中,我们将使用 RUNOOB 样本数据库。 下面是选自
数据库oracle for update of和for update的区别
数据库oracle锁: for update of和for update的区别,解释得很清楚,有很多详细例子说明。
oracle的update的五种方式
oracle的updateoracoracle的update的五种方式le的update的五种方式的五种方式oracle的update的五种方式
update 语句优化update 语句优化update 语句优化
update 语句优化
windows10 wsl_update_x64.zip wsl_update_x64.exe
windows10 wsl_update_x64.msi 网上下载很慢 下了一天才下载下来


