|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Member
Iscritto dal: Feb 2005
Messaggi: 86
|
Aiuto Postgresql
Richiesta di aiuto su Postgres
Esempio Creo una tabella "Comuni" come la seguente CREATE TABLE "Comuni_Prov" ( "ID_Comune" SERIAL NOT NULL, "Comune" varchar, CONSTRAINT "PK_Com" PRIMARY KEY("ID_Comune"), CONSTRAINT "Un_Comune" UNIQUE("Comune") Poi la tabella "Aree Comunali" CREATE TABLE "Aree_Comunali" ( "ID_Comune" int4 NOT NULL, "ID_Area" SERIAL NOT NULL, "Cod_Area" varchar, "Descrizione" varchar, "ID_Geom_Aree" SERIAL NOT NULL, CONSTRAINT "PK_Area_Comun" PRIMARY KEY("ID_Area","ID_Comune"), CONSTRAINT "Unic_Geom" UNIQUE("ID_Geom_Aree") Il campo COD_AREA deve essere popolato da carattere fisso = A seguito da un numero progressivo che aumenta per ogni AREA inserita che fa riferimento al solito comune Quindi la tabella AREE_COMUNALI verrebbe così: Comune= Firenze CodArea= A1 A2 A3 Comune= Roma CodArea= A1 A2 A3 Come posso fare? Grazie per l'aiuto Giovanni
__________________
Vendo (per ricambi) Notebook Asus A6KM-Q005H - 15.4 wxga - Turion MT30(1,6ghz 1mb cache l2) - 512mb kingston pc3200 400mhz - Geforce go 7300 256mb con scheda madre non funzionante |
![]() |
![]() |
![]() |
#2 | |
Member
Iscritto dal: Feb 2005
Messaggi: 86
|
Quote:
UPPPP
__________________
Vendo (per ricambi) Notebook Asus A6KM-Q005H - 15.4 wxga - Turion MT30(1,6ghz 1mb cache l2) - 512mb kingston pc3200 400mhz - Geforce go 7300 256mb con scheda madre non funzionante |
|
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 02:09.