- 论坛徽章:
- 0
|
Sequence问题?
1.informix :
serial类型, 用法:
create table cust
{ cust_id serial,
...}
insert 时不用指定此字段系统自动加1插入
select 时无特别跟整型一样
2.oracle:
建sequence seq_custid
create sequence seq_custid start 1 incrememt by 1;
建表时:
create table cust
{ cust_id smallint not null,
...}
insert 时:
insert into table cust
values( seq_cust.nextval, ...)
3.sybase:
identify字段属性,用法:
create tbale cust
{ cust_id number(8,0) identify,
...}
insert 时不能插入此字段系统自动加一插入此字段.
select 用法相同
4.db2:
identity字段属性 用法:
create table时
cust_id smallint not null generated always as indentity (start with
1 increment by 1)
insert 时:
insert into table cust (cust_id, ... )
values ( default, ...)
select 时
用法一样
各位老大我打的好吃力喔,, 呵呵 |
|