日期:2014-05-17 浏览次数:20482 次
with a as ( select col1,col2 from table1 ) update table2 set col3 = 1 where a.col1 = table2.col1 update table3 set col4 = 1 where a.col2 = table3.col2
select col1,col2 into #a from table1 update table2 set col3 = 1 from table2 inner join #a a on a.col1 = table2.col1 update table3 set col4 = 1 from table3 inner join #a a on where a.col2 = table3.col2