sql中重命名列怎么命名?

2025-03-07 10:48:10
推荐回答(3个)
回答1:

mysql中:
alter table 数据表名 change 原列名 新列名 新列类型;

oracle中:
alter table 数据表名 rename 原列名 to 新列名;

回答2:

用 as
也可以省略 as
比如说:select id as 序号 from Dbs;也可以写成select id 序号 from Dbs

回答3:

不同的数据库不一样,你是mysql,oracle还是db2?