Open xunqinbo opened 2 years ago
本帖仅供参考
` CREATE TABLE "region" ( "code" integer NOT NULL, "name" text NOT NULL, "parentCode" integer NOT NULL, "level" integer NOT NULL, CONSTRAINT "pk_code" PRIMARY KEY ("code") );
INSERT INTO region SELECT code,name,0,1 FROM province;
INSERT INTO region SELECT code,name,provinceCode,2 FROM city;
INSERT INTO region SELECT code,name,cityCode,3 FROM area;
INSERT INTO region SELECT code,name, areaCode,4 FROM street;
INSERT INTO region SELECT code,name,streetCode,5 FROM village;
`
本帖仅供参考
` CREATE TABLE "region" ( "code" integer NOT NULL, "name" text NOT NULL, "parentCode" integer NOT NULL, "level" integer NOT NULL, CONSTRAINT "pk_code" PRIMARY KEY ("code") );
INSERT INTO region SELECT code,name,0,1 FROM province;
INSERT INTO region SELECT code,name,provinceCode,2 FROM city;
INSERT INTO region SELECT code,name,cityCode,3 FROM area;
INSERT INTO region SELECT code,name, areaCode,4 FROM street;
INSERT INTO region SELECT code,name,streetCode,5 FROM village;
`