【问题标题】:want to update unmatching rows from table1 to table2 in sql想要在 sql 中将不匹配的行从 table1 更新到 table2
【发布时间】:2015-12-26 08:10:58
【问题描述】:

我想从表 Info 中追加表 Info1,其中 Update_date 列不匹配

例如,表 Info 的最后三个记录应添加到 Info1 表中

例如 '2015-12-25' 的记录应添加到 Info1

【问题讨论】:

标签: sql-server


【解决方案1】:
INSERT INTO info1(Name,Loc,Version_no,Update_date,update_time)
SELECT Name,Loc,Version_no,Update_date,update_time 
FROM info
WHERE cast(update_date as date) NOT IN (select cast(update_date as date) from info1);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-02-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多