sqlite中ALTER TABLE语句不支持DROP COLUMN,只有RENAME 和ADD
解决办法:

1.创建一个临时表,把除了要删的字段以外的字段加上

create table _temp as select _id,name,age,balance from person;

select * from _temp;

 

2.删除原表

drop table person;

 

3.把临时表命名成原表

alter table  _temp rename to person;

 

即可

转自:http://www.mamicode.com/info-detail-161149.html

相关文章:

  • 2021-12-02
  • 2021-12-21
  • 2021-07-12
  • 2021-06-05
  • 2021-12-03
  • 2022-12-23
  • 2021-04-05
猜你喜欢
  • 2021-09-12
  • 2021-12-23
  • 2021-06-16
  • 2022-12-23
  • 2022-01-24
  • 2022-12-23
  • 2022-02-04
相关资源
相似解决方案