ASP中怎么实现SQL数据库备份、恢复!(3)
DROP TABLE distributors;
CREATE TABLE distributors AS SELECT * FROM temp;
DROP TABLE temp;
ALTER TABLE table DROP [ COLUMN ] column { RESTRICT | CASCADE }
前,要删除一个现存的列,表必须重新创建和重新装载:
CREATE TABLE temp AS SELECT did, city FROM distributors;
DROP TABLE distributors;
CREATE TABLE distributors (
did DECIMAL(3) DEFAULT 1,
name VARCHAR(40) NOT NULL,
);
INSERT INTO distributors SELECT * FROM temp;
DROP TABLE temp;
重命名列/字段和表名是 PostgreSQL 扩展。SQL92 没有提供这些。
内容版权声明:除非注明,否则皆为本站原创文章。