Aide sur Distinct dans Select & Java

Fermé
supupoff Messages postés 310 Date d'inscription dimanche 27 novembre 2011 Statut Membre Dernière intervention 8 janvier 2021 - 6 mars 2013 à 00:52
supupoff Messages postés 310 Date d'inscription dimanche 27 novembre 2011 Statut Membre Dernière intervention 8 janvier 2021 - 6 mars 2013 à 15:25
Bonjour,


je veux afficher dans JCombobox la resultat d'une select tout en afficher pour RefProjet une seul fois,

mon essai :

rs =c.selection("SELECT RefProjet,idpro,NomProjet FROM projet,user where projet.iduser=user.id AND projet.IdChef='"+a.getid()+"' AND RefProjet in (select distinct(RefProjet) from projet)");
while(rs.next())
{
String num = rs.getString("idpro");
String nom = rs.getString("NomProjet");
String ref = rs.getString("IdProjet");
jComboBox2.addItem(new RF(nom,ref,num));
} } catch (Exception ex) {
ex.printStackTrace();
}

mais toujour m'affiche plusieur fois même RefProjet !!

aide svp

Merci d'avance
A voir également:

1 réponse

supupoff Messages postés 310 Date d'inscription dimanche 27 novembre 2011 Statut Membre Dernière intervention 8 janvier 2021 34
6 mars 2013 à 15:25
upup
0