oracle设置id自增(简单记录,以后补充)

第一步:

DROP sequence self_increasing_seq;
CREATE sequence self_increasing_seq minvalue 1 MAXVALUE 99999999 increment BY 1 START WITH 1;

第二步:

CREATE 
    OR REPLACE TRIGGER self_increasing_trigger BEFORE INSERT ON ENTRY_GOODS FOR EACH ROW
BEGIN
SELECT
    self_increasing_seq.nextval INTO : new.ID 
FROM
    DUAL;
END;

搞定

oracle设置id自增(简单记录,以后补充)

上一篇:CentOS 7 部署 Zabbix 5.0 基于 PostgreSQL-12 NGINX


下一篇:MySQL查询语句(SELECT)