postgreSQL 自动递增序号
时间:2019-01-04 23:57:18
收藏:0
阅读:479
创建表格
CREATE TABLE test ( id serial, name varchar(16) not null );
查询当前创建好的表格
插入数据
BEGIN TRANSACTION; INSERT INTO test(name) VALUES(‘A0001‘); commit;
再次查询表格,ID为1
插入第二条数据,序号自动为2
BEGIN TRANSACTION; INSERT INTO test(name) VALUES(‘A0002‘); commit;
重复第二步操作
未完待续…
原文:https://www.cnblogs.com/siyun/p/10223035.html
评论(0)