频道栏目
首页 > 资讯 > DB2 > 正文

HGDBPG表中添加删除列的方法

17-09-21        来源:[db:作者]  
收藏   我要投稿

HGDB表中添加删除列:

highgo=# \d test

Table "public.test"

Column | Type | Modifiers

--------+---------+------------

id | integer | default 15

no | integer |

highgo=# select * from test;

id | no

----+----

15 | 1

15 | 2

15 |

(3 rows)

highgo=# alter table test add column name varchar(10);

ALTER TABLE

highgo=# select * from test;

id | no | name

----+----+------

15 | 1 |

15 | 2 |

15 | |

(3 rows)

highgo=# insert into test (no,name) values (1,'a');

INSERT 0 1

highgo=#

highgo=# select * from test;

id | no | name

----+----+------

15 | 1 |

15 | 2 |

15 | |

15 | 1 | a

(4 rows)

highgo=# alter table test drop column name;

ALTER TABLE

highgo=# select * from test;

id | no

----+----

15 | 1

15 | 2

15 |

15 | 1

(4 rows)

相关TAG标签
上一篇:HGDB如何查看当前会话的pid
下一篇:Linux下多路径multipath配置
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站