日期:2014-05-18 浏览次数:20528 次
if exists( select * from table where 学号=xxx) update...... else insert......
------解决方案--------------------
update a set col = b.col from a, b where a.id = b.id
insert into a select * from b where id not in (select id from a)
------解决方案--------------------
if exists(select * from table where 学号=xxx )
begin
update......
end
else
begin
insert......
end
------解决方案--------------------
insert into ....on duplicate key update...