由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - 初级问题
相关主题
SQL Server Trigger on System Base Table or Catalog View如何用SQL语句判断一个TABLE是否存在?
SQL问题请教: add one more columnSQL help.
SQL Server table variable 的一个问题请教。问个笨问题
问个external table field definition的问题Basic oracle questions.
SQL combine two columns from two different tables no shared (转载)Please help: Innodb table could not drop a column
我的DBA在生成ORACLE table的时候需要一个一个column看Re: Please help: Innodb table could not
Table Merge (SQL Server)请教比较两个table,找出相同和不同的records
SQL Server - how to obtain data type namehelp about SQL for ACCESS
相关话题的讨论汇总
话题: table话题: emp话题: alter话题: column话题: rename
进入Database版参与讨论
1 (共1页)
as
发帖数: 5
1
建好一个TABLE之后,可以再加一列吗?
可以改这个TABLE的名字吗?
l***u
发帖数: 157
2
呵呵,加一列是没问题的,改名字嘛...没试过,哪位指导一下?

【在 as 的大作中提到】
: 建好一个TABLE之后,可以再加一列吗?
: 可以改这个TABLE的名字吗?

c********h
发帖数: 191
3

copy the table and assign it with another name.

【在 l***u 的大作中提到】
: 呵呵,加一列是没问题的,改名字嘛...没试过,哪位指导一下?
as
发帖数: 5
4

谢了,仔细读了一遍USER's GUIDE, 发现用ALTER可以
加一列,或改名。我用的是POSTGRESQL。

【在 c********h 的大作中提到】
:
: copy the table and assign it with another name.

u**e
发帖数: 177
5
You can add a fresh column, but this column must be "NULL".
You can not change the table's name.

【在 as 的大作中提到】
: 建好一个TABLE之后,可以再加一列吗?
: 可以改这个TABLE的名字吗?

d**d
发帖数: 20
6

Sure he can, just create a new table (with the new name)
with all the columns and rows of the previous table.
Then delete the old table.
just simple like mv command in unix

【在 u**e 的大作中提到】
: You can add a fresh column, but this column must be "NULL".
: You can not change the table's name.

k***n
发帖数: 12
7

In MS SQLServer,you can use
alter table to add a column and use
sp_rename to rename the table name

【在 as 的大作中提到】
: 建好一个TABLE之后,可以再加一列吗?
: 可以改这个TABLE的名字吗?

as
发帖数: 5
8

In postgresql user's guide, I found:
ALTER TABLE name1 ADD COLUMN name2 type
or
ALTER TABLE name1 RENAME TO name2

【在 k***n 的大作中提到】
:
: In MS SQLServer,you can use
: alter table to add a column and use
: sp_rename to rename the table name

l***u
发帖数: 157
9

POST-GRE-SQL是在美国读博士需要考的SQL吗,呵呵...

【在 as 的大作中提到】
:
: In postgresql user's guide, I found:
: ALTER TABLE name1 ADD COLUMN name2 type
: or
: ALTER TABLE name1 RENAME TO name2

q*j
发帖数: 156
10
alter table

【在 as 的大作中提到】
: 建好一个TABLE之后,可以再加一列吗?
: 可以改这个TABLE的名字吗?

f****s
发帖数: 10
11
哈哈

【在 l***u 的大作中提到】
:
: POST-GRE-SQL是在美国读博士需要考的SQL吗,呵呵...

B*****n
发帖数: 135
12
In oracle:
suppose you already have a table EMP(name Varchar2(30), salary Number);
and you want to add a column called 'id', just do:
SQL> ALTER TABLE EMP ADD (id Number);
if you now want to populate this id column from 1 to the number of existing
employees in the EMP table, just do:
SQL> UPDATE EMP SET id = rownum;
To rename table 'EMP' to 'EMPLOYEE', just do:
SQL> RENAME EMP TO EMPLOYEE;

【在 as 的大作中提到】
: 建好一个TABLE之后,可以再加一列吗?
: 可以改这个TABLE的名字吗?

1 (共1页)
进入Database版参与讨论
相关主题
help about SQL for ACCESSSQL combine two columns from two different tables no shared (转载)
Help on Sql server huge table performance我的DBA在生成ORACLE table的时候需要一个一个column看
Help! A cluster method in SQLTable Merge (SQL Server)
请教SQL server的一个programming的问题,谢谢SQL Server - how to obtain data type name
SQL Server Trigger on System Base Table or Catalog View如何用SQL语句判断一个TABLE是否存在?
SQL问题请教: add one more columnSQL help.
SQL Server table variable 的一个问题请教。问个笨问题
问个external table field definition的问题Basic oracle questions.
相关话题的讨论汇总
话题: table话题: emp话题: alter话题: column话题: rename