(1):
以下是完成一个表的创建并且指定其主键
SQL> create table test_forum_dategroup
2 (id integer not null,
3 sub_id integer,
4 prgm_id integer,
5 start_date date,
6 end_date date);
Table created
SQL> select * from test_forum_dategroup
2 /
ID SUB_ID PRGM_ID START_DATE END_DATE
--------------------------------------- --------------------------------------- --------------------------------------- ----------- -----------
SQL> alter table test_forum_dategroup
2 add constraint pk_test_forum primary key(id)
3 /
Table altered
SQL> desc test_forum_dategroup
Name Type Nullable Default Comments
---------- ------- -------- ------- --------
ID INTEGER
SUB_ID INTEGER Y
PRGM_ID INTEGER Y
START_DATE DATE Y
END_DATE DATE Y
http://bbs.chinaunix.net/thread-1032437-1-1.html
以下是完成一个表的创建并且指定其主键
SQL> create table test_forum_dategroup
2 (id integer not null,
3 sub_id integer,
4 prgm_id integer,
5 start_date date,
6 end_date date);
Table created
SQL> select * from test_forum_dategroup
2 /
ID SUB_ID PRGM_ID START_DATE END_DATE
--------------------------------------- --------------------------------------- --------------------------------------- ----------- -----------
SQL> alter table test_forum_dategroup
2 add constraint pk_test_forum primary key(id)
3 /
Table altered
SQL> desc test_forum_dategroup
Name Type Nullable Default Comments
---------- ------- -------- ------- --------
ID INTEGER
SUB_ID INTEGER Y
PRGM_ID INTEGER Y
START_DATE DATE Y
END_DATE DATE Y
http://bbs.chinaunix.net/thread-1032437-1-1.html