0

例如,我有一张桌子,

Health condition    |   Description
-----------------------------------------------
OtherHealth         |   Other Health Care Needs
TraumaBrain         |   Traumatic Brain Injury
None                |   None

现在,我很遗憾我最后添加了最后一列。现在这张表上有依赖关系,所以我不能截断并重新插入它们。所以我正在寻找一种将最后一行放在首位的方法。

4

1 回答 1

0

要重新排列这两列,请使用

alter table t rename column "Health condition" to c1;
alter table t rename column "Description" to c2;
update t set c1=c2, c2=c1;
alter table t rename column c1 to "Description";
alter table t rename column c2 to "Health condition";
于 2013-09-26T12:46:29.937 回答