Représentation Intervallaire
Posté : 31 oct. 2008, 18:23
Bonjour à toutes et tous,
Ca fait maintenant 3 semaine que je suis sur ma Représentation Intervallaire (RI), maintenant, j'aimerais savoir comment la représenter, exemple :
Par avance merci de votre aide
Ca fait maintenant 3 semaine que je suis sur ma Représentation Intervallaire (RI), maintenant, j'aimerais savoir comment la représenter, exemple :
J'ai pensé à un GROUP BY et à un ORDER BY, mais coince ici :Voiture
Peugeot
Renault
Clio
Laguna
Citroën
Bâteau
...
Code : Tout sélectionner
SELECT B.* FROM categories_r_:type AS A, categories_r_:type AS B WHERE A.pk_categorie=:pk_categorie AND B.BordGauche >= A.BordGauche AND B.BordDroit <= A.BordDroit AND B.Niveau=(A.Niveau+1) ORDER BY B.nom ASC LIMIT 50;Code : Tout sélectionner
-- Table: ri
-- DROP TABLE ri;
CREATE TABLE ri --table modèle, ne vous inquietez pas
(
pk_categorie serial NOT NULL,
"BordDroit" integer,
"BordGauche" integer,
nom character(64),
"Niveau" numeric(4),
CONSTRAINT ri_pkey PRIMARY KEY (id),
CONSTRAINT ri_id_key UNIQUE (id)
)
WITH (OIDS=FALSE);
ALTER TABLE ri OWNER TO katagoto;