zoukankan      html  css  js  c++  java
  • b表中有的塞给a表

    UPDATE aa set Col_Col=
    case
     when  aa.Col_Col is null or aa.Col_Col='' then bb.col_col
     else aa.Col_Col
    end
    --,aa.Col_Col,bb.Col_Col,*
     from
    (select * from d_col_detail where 
    CONVERT(varchar(10),Modtime,120)=convert(varchar(10),GETDATE(),120)
    and Db_name='EMBASE.EMBase2'
    ) aa
    inner join
    (select * from dbo.d_col_detail0312
    where ID in (
     select ID from d_col_detail where 
    CONVERT(varchar(10),Modtime,120)=convert(varchar(10),GETDATE(),120)
    and Db_name='EMBASE.EMBase2'
    ) and Col_Col<>'') bb
    on aa.Node_name=bb.Node_name and aa.Db_name=bb.Db_name and aa.Tab_name=bb.Tab_name  and aa.Col_name=bb.Col_name

  • 相关阅读:
    Python学习-day10
    python学习-day9
    Python学习-day8
    Python学习-day7
    Python学习-day6
    Django2
    Django讲解
    JQuery讲解
    前端Day2
    前端Day1
  • 原文地址:https://www.cnblogs.com/evablog/p/2984706.html
Copyright © 2011-2022 走看看