Bonjour,

Voici une requête qui porte sur trois tables,
qui fonctionne, si je l'écris ainsi
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
Select distinct
       sum( ver.ver_somme) as VERSE
 
from   t_individu_ind ind,
       t_inscription_ins ins,
       t_versement_ver ver
 
where ins.ins_ind_id =ind.ind_id
      and ver.ver_ind_id =ins.ins_ind_id
      and ver.ver_valid='OUI'
 
ORDER by IND.ind_nom;
qui fonctionne encore dans cette 2ème version
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 
Select distinct
       ind.ind_nom,
       ind.ind_prenom,
       ins.ins_ind_id,
       (ins.INS_VAL_LIC+INS.INS_VAL_COT)AS DU,
       ver.ver_valid
from   t_individu_ind ind,
       t_inscription_ins ins,
       t_versement_ver ver
 
where ins.ins_ind_id =ind.ind_id
      and ver.ver_ind_id =ins.ins_ind_id
      and ver.ver_valid='OUI'
 
ORDER by IND.ind_nom;
Et qui ne fonctionne plus, si je demande tout ensemble (ce que je souhaite) erreur : colonne de référence ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Select distinct
       ind.ind_nom,
       ind.ind_prenom,
       ins.ins_ind_id,
       (ins.INS_VAL_LIC+INS.INS_VAL_COT)AS DU,
       ver.ver_valid,
       sum( ver.ver_somme) as VERSE
 
from   t_individu_ind ind,
       t_inscription_ins ins,
       t_versement_ver ver
 
where ins.ins_ind_id =ind.ind_id
      and ver.ver_ind_id =ins.ins_ind_id
      and ver.ver_valid='OUI'
 
ORDER by IND.ind_nom;
Quelqu'un pourrait-il m'indiquer mon erreur,
Merci d'avance,
Lucien