序列在DML中使用

最近更新时间: 2025-02-18 16:02:00

  • 复制
    复制成功
postgres=# create table t(id int ,nickname varchar(15));
postgres=# INSERT INTO t (id,nickname) VALUES(nextval('tbase_seq'),'TBase好');    
postgres=# select * from t;
 id | nickname  
----+-----------
  1 | 腾讯TDSQL PG
  2 | TDSQL PG好
(2 rows)