1,如何实现id自增长?
在mysql,中使用"id int primary auto_increment"即可实现。但是在postgresql中
drop table acount;
CREATE TABLE "public"."acount" (
"id" SERIAL primary key,
"acount_name" varchar(6) COLLATE "default" NOT NULL,
"county_money" varchar(50) COLLATE "default" NOT NULL
)
WITH (OIDS=FALSE)
;
ALTER TABLE "public"."acount" OWNER TO "postgres";
insert into acount(acount_name,county_money) values('zhouyi','10000');
insert into acount(acount_name,county_money) values('zhou26','10000');
insert into acount(acount_name,county_money) values('zhou23','10000');
insert into acount(acount_name,county_money) values('zhou24','10000');
insert into acount(acount_name,county_money) values('zhou25','10000')
成功截图: