当前位置:网站首页>Sqlite A列数据复制到B列

Sqlite A列数据复制到B列

2022-07-31 05:15:00 为今天而努力

测试数据:
alter table test add column_1 int; 
insert into test (column_1) values(1),(2),(3);
实际操作:

// 添加新列
alter table test add column_2 int;
update test set column_2 = column_1;  //  将column_1的数据 copy 到 column_2;

// 重置原有列数据。
update test set column_1 = 0;


大功告成!!!

原网站

版权声明
本文为[为今天而努力]所创,转载请带上原文链接,感谢
https://blog.csdn.net/ff_hh/article/details/115012284