把數據導出來後,創建一個表,然後把導出表的數據用
insert into 新表 select * from 導出表
這樣新表的列標師說出來了。update a set aprice='aaa',cont=123,cuprice=12.5 where .......
insert into 新表 select * from 導出表
這樣新表的列標師說出來了。update a set aprice='aaa',cont=123,cuprice=12.5 where .......
主要更新三个字段aprice cont cuprice
update xsact set aprice=xsact2里的aprice,cont=xsact2里的cont,cuprice=xsact2里的cuprice where xsact里的porder=xsact2里的porder and xsact里的eda=xsact2里的eda and xsact里的bun=xsact2里的bun具体怎么写啊?
DECLARE @_porder varchar(20), @_eda varchar(20),@_bun varchar(20),@_aprice decimal(28,6),@_cont varchar(255),@_cuprice decimal(28,6)
DECLARE changePrice_cursor CURSOR FOR
select porder,eda,bun,aprice,cont,cuprice from xsact2
open changePrice_cursor
FETCH NEXT FROM changePrice_cursor
into @_porder,@_eda,@_bun,@_aprice,@_cont,@_cuprice
WHILE @@FETCH_STATUS = 0
begin
update xsact set aprice=@_aprice,cont=@_cont,cuprice=@_cuprice where porder=@_porder and eda=@_eda and bun=@_bun
FETCH NEXT FROM changePrice_cursor
into @_porder,@_eda,@_bun,@_aprice,@_cont,@_cuprice
end
CLOSE changePrice_cursor
DEALLOCATE changePrice_cursor