Précédent   Forum du club des développeurs et IT Pro > Environnements de développement > WinDev > HyperFileSQL
HyperFileSQL HyperFileSQL est un système de gestion de base de données relationnel exploité par les logiciels WinDev, WebDev et WinDev Mobile.
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse
 
Outils de la discussion
Publicité
'
Vieux 09/12/2012, 08h05   #1
android32
Invité régulier
 
Homme
Étudiant
Inscription : juillet 2012
Messages : 20
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations professionnelles :
Activité : Étudiant
Secteur : High Tech - Matériel informatique

Informations forums :
Inscription : juillet 2012
Messages : 20
Points : 9
Points : 9
Par défaut creer requete a colonnes suplementaires

Bonjour
j'ai ces 2 requetes et 4 tables

adherents(id_adherents,.......)

acconage(id_acconage,#id_adherents,#id_shift.......)

transit(id_transit,#id_adherents,#id_shift,.......)

shift(id_adherents,.......)



Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
SELECT
ADHERENTS.lib_adherents AS lib_adherents,
SUM(FICHE_EMBAUCHE_ACCONAGE.docker_emb) AS la_somme_docker_emb,
shift.shift_lib AS shift_lib
FROM
shift,
FICHE_EMBAUCHE_ACCONAGE,
ADHERENTS
WHERE
FICHE_EMBAUCHE_ACCONAGE.IDshift = shift.IDshift
AND FICHE_EMBAUCHE_ACCONAGE.IDADHERENTS = ADHERENTS.IDADHERENTS
AND
(
shift.shift_lib = 'JOUR'
)
GROUP BY
ADHERENTS.lib_adherents,
shift.shift_lib
-------------
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
SELECT
ADHERENTS.lib_adherents AS lib_adherents,
SUM(FICHE_EMBAUCHE_ACCONAGE.docker_emb) AS la_somme_docker_emb,
shift.shift_lib AS shift_lib
FROM
shift,
FICHE_EMBAUCHE_ACCONAGE,
ADHERENTS
WHERE
FICHE_EMBAUCHE_ACCONAGE.IDshift = shift.IDshift
AND FICHE_EMBAUCHE_ACCONAGE.IDADHERENTS = ADHERENTS.IDADHERENTS
AND
(
shift.shift_lib = 'NUIT'
)
GROUP BY
ADHERENTS.lib_adherents,
shift.shift_lib
Vous remarquerez que ces 2 requête ont une colonne en commun qui est la colonne lib_adherents

je voudrais a partir de ces 2 requêtes de 3 colonnes chacune créer une 3e requête de 4 colonnes
qui seront

lib_adherents------total_effectif_shift_Jour------ total_effectif_shift nuit----totaleffectif_shift
exemple
en utilisant la clause UNION ALL avec ces 2 requetes j'obtiens

societe_alpha 10
societe_alpha 20
je voudrais donc obtenir
societe_alpha 10 20 30

est ce possible?
android32 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 09/12/2012, 18h09   #2
android32
Invité régulier
 
Homme
Étudiant
Inscription : juillet 2012
Messages : 20
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations professionnelles :
Activité : Étudiant
Secteur : High Tech - Matériel informatique

Informations forums :
Inscription : juillet 2012
Messages : 20
Points : 9
Points : 9
merci de n'avoir pas répondu
cela m'a permit de chercher encore plus
et de trouver la solution grâce aux produit cartésien
Merci
android32 est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Cette discussion est résolue.
Outils de la discussion

Navigation rapide


Fuseau horaire GMT +2. Il est actuellement 05h02.


 
 
 
 
Partenaires

Hébergement Web