OVH Cloud OVH Cloud

Pb de requete

4 réponses
Avatar
yannick
Bonsoir,
J’ai une table Formation et une table Participant
Si je fais une requête :

SELECT Formation.N°Formation, Formation.RS, Formation.cp, Formation.Ville,
Participant.Nom, Participant.Prénom
FROM Participant INNER JOIN Formation ON Participant.N°Formation =
Formation.N°Formation

J’obtiens par ex : 3 fois le N°Formation 45 si j’ai 3 participants pour
cette formation.

Peut on obtenir une seule ligne avec N°Formation 45 …….. Nom1, Prénom1,
Nom2, Prénom2, Nom3, Prénom3 ?

Les noms et prénoms dépendront du nombre de participants.

Merci pour tous ceux qui voudront bien se pencher sur mon problème.

Bonne soirée

@+

Yannick

4 réponses

Avatar
Philippe T [MS]
Bonjour,

Il n'y a pas de solutions native en SQL.

Il y a déja eu une question du genre et une réponse de Jessy sur le forum a
été :

http://access.jessy.free.fr/index.html?Menu=3&Page=ConcatForQuery

Phil.
________________________________________________________
Philippe TROTIN http://blogs.msdn.com/ptrotin
Microsoft Services France http://www.microsoft.com/france

"yannick" wrote in message
news:
Bonsoir,
J'ai une table Formation et une table Participant
Si je fais une requête :

SELECT Formation.N°Formation, Formation.RS, Formation.cp, Formation.Ville,
Participant.Nom, Participant.Prénom
FROM Participant INNER JOIN Formation ON Participant.N°Formation > Formation.N°Formation

J'obtiens par ex : 3 fois le N°Formation 45 si j'ai 3 participants pour
cette formation.

Peut on obtenir une seule ligne avec N°Formation 45 .... Nom1, Prénom1,
Nom2, Prénom2, Nom3, Prénom3 ?

Les noms et prénoms dépendront du nombre de participants.

Merci pour tous ceux qui voudront bien se pencher sur mon problème.

Bonne soirée

@+

Yannick



Avatar
yannick
Merci Philippe de ta réponse,
mais le probleme etant que je ne peux pas concatener des champs car je m’en
sers pour du publipostage.
Il me faut simplement une seule ligne avec nom1, prenom1, nom2, prenom2,
nom3, prenom3, nom4, prenom4, nom5, prenom5, si j’ai 5 fois le même
N°formation

Avec plusieurs requêtes imbriquees peut on faire cette manipulation ?

Je suis en train de tester.

Merci pour les réponses.

@+
Yannick


Bonjour,

Il n'y a pas de solutions native en SQL.

Il y a déja eu une question du genre et une réponse de Jessy sur le forum a
été :

http://access.jessy.free.fr/index.html?Menu=3&Page=ConcatForQuery

Phil.
________________________________________________________
Philippe TROTIN http://blogs.msdn.com/ptrotin
Microsoft Services France http://www.microsoft.com/france

"yannick" wrote in message
news:
Bonsoir,
J'ai une table Formation et une table Participant
Si je fais une requête :

SELECT Formation.N°Formation, Formation.RS, Formation.cp, Formation.Ville,
Participant.Nom, Participant.Prénom
FROM Participant INNER JOIN Formation ON Participant.N°Formation > > Formation.N°Formation

J'obtiens par ex : 3 fois le N°Formation 45 si j'ai 3 participants pour
cette formation.

Peut on obtenir une seule ligne avec N°Formation 45 .... Nom1, Prénom1,
Nom2, Prénom2, Nom3, Prénom3 ?

Les noms et prénoms dépendront du nombre de participants.

Merci pour tous ceux qui voudront bien se pencher sur mon problème.

Bonne soirée

@+

Yannick








Avatar
Philippe T [MS]
Bonjour,

Même avec des requètes imbriquées, il n'y a pas de solution en SQL en dehors
de créer une table temporaire et ajouter des colonnes si nécessaires dans
cette table dynamiquement. :-(

Phil.
________________________________________________________
Philippe TROTIN http://blogs.msdn.com/ptrotin
Microsoft Services France http://www.microsoft.com/france

"yannick" wrote in message
news:
Merci Philippe de ta réponse,
mais le probleme etant que je ne peux pas concatener des champs car je m'
en

sers pour du publipostage.
Il me faut simplement une seule ligne avec nom1, prenom1, nom2, prenom2,
nom3, prenom3, nom4, prenom4, nom5, prenom5, si j'ai 5 fois le même
N°formation

Avec plusieurs requêtes imbriquees peut on faire cette manipulation ?

Je suis en train de tester.

Merci pour les réponses.

@+
Yannick


Bonjour,

Il n'y a pas de solutions native en SQL.

Il y a déja eu une question du genre et une réponse de Jessy sur le
forum a


été :

http://access.jessy.free.fr/index.html?Menu=3&Page=ConcatForQuery

Phil.
________________________________________________________
Philippe TROTIN http://blogs.msdn.com/ptrotin
Microsoft Services France http://www.microsoft.com/france

"yannick" wrote in message
news:
Bonsoir,
J'ai une table Formation et une table Participant
Si je fais une requête :

SELECT Formation.N°Formation, Formation.RS, Formation.cp,
Formation.Ville,



Participant.Nom, Participant.Prénom
FROM Participant INNER JOIN Formation ON Participant.N°Formation > > > Formation.N°Formation

J'obtiens par ex : 3 fois le N°Formation 45 si j'ai 3 participants
pour



cette formation.

Peut on obtenir une seule ligne avec N°Formation 45 .... Nom1,
Prénom1,



Nom2, Prénom2, Nom3, Prénom3 ?

Les noms et prénoms dépendront du nombre de participants.

Merci pour tous ceux qui voudront bien se pencher sur mon problème.

Bonne soirée

@+

Yannick










Avatar
Eric
Bonjour Yannick,

Voir ma proposition sur ton post de ce jour relatif au publipostage.
A+
Eric