sqlite删除字段办法 near 'drop':syntax error;

sqlite删除字段时提示附近有语法错误,怎么解决呢?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;

sqlite删除字段办法 near 'drop':syntax error;

时间: 2024-07-30 10:19:50

sqlite删除字段办法 near 'drop':syntax error;的相关文章

sqlite数据库下载安装和初步操作和所遇到的问题near "sqlite3":syntax error

1.下载sqlite数据库:http://www.sqlite.org/download.html 如果是在window上安装需要在 Windows 区下载预编译的二进制文件.如图下载下载 sqlite-shell-win32-*.zip 和 sqlite-dll-win32-*.zip 压缩文件. ) 2.下载下来后解压 sqlite-shell-win32-*.zip 和 sqlite-dll-win32-*.zip 压缩文件得到sqlite3.def.sqlite3.dll 和 sqlit

Syntax error, 'for each' statements are only available if source level is 1.5的解决办法

出现这个情况说明javaEE的版本过低了,可以将其换为1.5以上的具体步骤如下: 1.点击项目后右键选择properties,然后选择java build path 2.remove版本过低的包,选择Add library... 3.选择MyEclipse Libraries 4.选择相应的包 5.点击Finish后 Syntax error, 'for each' statements are only available if source level is 1.5的解决办法

帝国备份王出现 Parse error: syntax error, unexpected end of file解决办法

帝国备份王出现 Parse error: syntax error, unexpected end of file解决办法,今天在WIN7 64位系统 用Xampp v3.2.2, 帮客户备份一下数据库,发现居然出现Parse error: syntax error, unexpected end of file iProg 的错误, 在网上搜索了一下,找到了解决办法.这里分享给大家. 解决办法:打开 php.ini ,找到 short_open_tag = Off 这一行,将 Off 修改为

redis 集群新增节点,slots槽分配,删除节点, [ERR] Calling MIGRATE ERR Syntax error, try CLIENT (LIST | KILL | GET...

redis reshard 重新分槽(slots) https://github.com/antirez/redis/issues/5029 redis 官方已确认该bug redis 集群重新(reshard)分片故障 [ERR] Calling MIGRATE ERR Syntax error, try CLIENT (LIST | KILL | GETNAME | SETNAME | PAUSE | REPLY) 错误背景描述 redis版本:4.0.1 ruby gem reids 版本

syntax error: Bad for loop variable 解决办法

在deepin下跑一个测试脚本,提示for 循环的语法错误:syntax error: Bad for loop variable  2014版本deepin是基于ubuntu,2015版deepin基于debian,问题应该出现再dash上,dash 是Debian的版本. 解决方法是:取消dashsudo dpkg-reconfigure dash在选择项中选否,即可.

php artisan migrate时出现 SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes解决办法

在测试队列中运用artisan命令行 php artisan queue:table php artisan migrate时出现 SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes Change database.php which is in config folder where it says 'charset' =

Oracle 增加修改删除字段

添加字段的语法:alter table tablename add (column datatype [default value][null/not null],-.); 修改字段的语法:alter table tablename modify (column datatype [default value][null/not null],-.); 删除字段的语法:alter table tablename drop (column); 添加.修改.删除多列的话,用逗号隔开. 使用alter

安装SQL Servre2000时提示“command line option syntax error! type command /? for help”

问题: 当程序正在安装ms数据访问组件时,弹出错误提示框:command line option syntax error,type command/? for help,点击确定继续:到了程序正在安装HTML帮助时,弹出标题为html help 1.32 update错误提示框:command line option syntax error,type command/? for help,点击确定继续:程序开始复制文件,复制完后弹出错误提示框:无法找到动态连接库sqlunirl.dll(sq

关于报错“syntax error near unexpected token `”和回车换行

本来是很简单一个事情,转过来是因为打字机这事比较有趣-- http://blog.csdn.net/xyp84/archive/2009/08/11/4435899.aspx 摘要一下: 回车 换行 0D 0A <CR> <LF> Carriage Return Line Feed "/r" "/n" win32 0D 0D 0A unix 0D 0A ============淡定的分割线=============== 今天写了个shell脚