|
Publicité ' | |||||||||||||||||||||||
|
|
#1 |
|
Membre du Club
![]() Inscription : mars 2004 Messages : 89 ![]() |
Bonjour tout le monde,
je cherche à faire une incrémentation par un UPDATE (je ne vais pas trop m'attarder sur le pourquoi car ca serait un peu long) Le probleme actuel est que qd je lance cet UPDATE, l'attribut 'numero' de la table deposants_tbl s'incrémente sur tous les deposants et non sur le concerné. Voila mon code: UPDATE ONLY deposants_tbl SET numero=deposants_tbl.numero+1 FROM deposants_tbl AS d, articles_tbl AS a WHERE a.id_articles=(select max(id_articles) from articles_tbl) AND a.id_deposant=d.id_deposant; MERCI |
|
|
00
|
|
|
#2 |
|
Membre du Club
![]() Inscription : mars 2004 Messages : 89 ![]() |
Table "public.articles_tbl"
Colonne | Type | Modifications ----------------+-------------------+--------------- id_articles | integer | not null id_deposant | integer | id_geographie | integer | id_employe | integer | id_famille | integer | description | text | not null observation | text | not null assure | boolean | not null cle | boolean | not null id_fournisseur | integer | id_article | character varying | Index: articles_tbl_pkey primary key btree (id_articles) Foreign Key constraints: FK_deposant FOREIGN KEY (id_deposant) REFERENCES deposants_tbl(id_deposant) ON UPDATE RESTRICT ON DELETE RESTRICT, FK_employe FOREIGN KEY (id_employe) REFERENCES employes_tbl(id_employe) ON UPDATE RESTRICT ON DELETE RESTRICT, FK_famille FOREIGN KEY (id_famille) REFERENCES famille_tbl(id_famille) ON UPDATE RESTRICT ON DELETE RESTRICT, FK_geo FOREIGN KEY (id_geographie) REFERENCES geographie_tbl(id_geographie) ON UPDATE RESTRICT ON DELETE RESTRICT, FK_fournisseur FOREIGN KEY (id_fournisseur) REFERENCES fournisseurs_tbl(id_fournisseur) ON UPDATE RESTRICT ON DELETE RESTRICT |
|
|
00
|
|
|
#3 |
|
Membre du Club
![]() Inscription : mars 2004 Messages : 89 ![]() |
Table "public.deposants_tbl"
Colonne | Type | Modifications --------------+-------------------+--------------- id_deposant | integer | not null cp | integer | societe | character varying | nom | character varying | not null prenom | character varying | not null adresse | text | not null pays | character varying | not null tel_domicile | integer | not null tel_bureau | integer | tel_portable | integer | mail | character varying | fax | integer | observation | text | mdp | integer | not null blocage | boolean | not null profession | character varying | numero | integer | Index: deposants_tbl_pkey primary key btree (id_deposant) Foreign Key constraints: FK_cp FOREIGN KEY (cp) REFERENCES cp_tbl(cp) ON UPDATE RESTRICT ON DELETE RESTRICT |
|
|
00
|
|
|
#4 |
|
Membre du Club
![]() Inscription : mars 2004 Messages : 89 ![]() |
Personne ne veux m'aider?????
SNIFFOUILLLE
|
|
|
00
|
|
|
#5 | ||
![]() ![]() Alain Ingénieur d'études décisionnel Inscription : mai 2002 Messages : 4 443 ![]() |
Code :
|
||
|
|
00
|
|
|
#6 |
|
Membre du Club
![]() Inscription : mars 2004 Messages : 89 ![]() |
Il ne manquait pas grand chose mais c'est exactement pourcela que j'ai tourné en rond pendant 2 heures!!!!
Merci bcp de ton aide al1_24 |
|
|
00
|
|
|
#7 |
![]() ![]() Alain Ingénieur d'études décisionnel Inscription : mai 2002 Messages : 4 443 ![]() |
Ne pas oublier le tag [Résolu]
|
|
|
00
|
Copyright © 2000-2012 - www.developpez.com