MySQL "alter table" syntax got problem
登录 | 论坛导航 -> 华新鲜事 -> 求学狮城 | 本帖共有 4 楼,当前显示第 4 楼 : 从楼主开始阅读 : 本帖树形列表 : 返回上一页
作者:MrDJay (等级:10 - 炉火纯青,发帖:10172) 发表:2004-05-14 11:16:14  4楼 
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

Ever Thine, Ever Mine, Ever Ours
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!原文 / 传统版 / WAP版只看此人从这里展开收起列表

本帖共有 4 楼,当前显示第 4 楼,本文还有 N-1 层楼,要不你试试看:点击此处阅读更多 >>



请登录后回复:帐号   密码