alter table my_table add column my_colunm varchar(eg) default "default";
登录 | 论坛导航 -> 华新鲜事 -> 求学狮城 | 本帖共有 2 楼,分 1 页, 当前显示第 1 页 : 本帖树形列表 : 刷新 : 返回上一页
<<始页  [1]  末页>>
作者:MrDJay (等级:10 - 炉火纯青,发帖:10172) 发表:2004-05-13 12:01:43  楼主  关注此帖
MySQL "alter table" syntax got problemI am trying to add a column into an existing table using ALTER TABLE table_name ADD COLUMN column_name column_definition FIRST another_column the FIRST keyword got syntax error. btw, i am using MySQL 4 Could anyone help to solve this problem? (more...)
alter table my_table add column my_colunm varchar(eg) default "default";
Ever Thine, Ever Mine, Ever Ours
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!原文 / 传统版 / WAP版所有回复从这里展开收起列表
作者:MrDJay (等级:10 - 炉火纯青,发帖:10172) 发表:2004-05-14 11:16:14  2楼
actually ur this sql query only insert a new column at the end of the tablewhat i want is to insert a new column at the beginning of the table. And, i just found out that there is no problem with the keyword "FIRST" at all. I read the manual wrongly yesterday. ====================== ALTER [IGNORE] TABLE tbl_name alter_specification [, alter_specification] ... alter_specification: ADD [COLUMN] column_definition [FIRST | AFTER col_name ]......... ======================= So, to add a column at the beginning of the table, use "alter table my_table add column my_colunm column_definition FIRST". To add a column at any other place rather than the beginning of the table, use "table my_table add column my_colunm column_definition AFTER clolumn_B" (more...)
ic, sorry
did not tell from your first post that you want to /have to insert it at the beginning of the table :P

欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!原文 / 传统版 / WAP版所有回复从这里展开收起列表
论坛导航 -> 华新鲜事 -> 求学狮城 | 返回上一页 | 本主题共有 2 篇文章,分 1 页, 当前显示第 1 页 | 回到顶部
<<始页  [1]  末页>>

请登录后回复:帐号   密码