1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
| SELECT Employe.Matricule
, Employe.Soc
, Employe.Nom
, Employe.Prenom
, Employe.Sexe
, Employe.Panel
, Employe.Actif,
, ListeSocietes.Libelle AS LibelleSociete
, Etablissement.Ets
, Section.Code AS CodeSection
, ListeSections.Libelle AS LibelleSection,
, Classification.Code AS CodeClassification
, ListeClassifications.Libelle AS LibelleClassification
, ListeClassifications.Niveau
, Statut.Libelle AS LibelleStatut,
, Pole_Technologique.Valeur AS PoleTechno,
, Site.Libelle AS LibelleSite,
, Contrat.Libelle AS LibelleContrat,
, ListeResponsables.Nom + ' ' + ListeResponsables.Prenom AS NomResponsable,
, Activite.Pourcentage AS TauxActivite
FROM dbo.Employe
LEFT JOIN dbo.ListeSocietes
ON Employe.Soc = ListeSocietes.Soc
LEFT JOIN dbo.Etablissement
ON Employe.Matricule = Etablissement.Matricule
AND Employe.Soc = Etablissement.Soc
LEFT JOIN dbo.Section
ON Employe.Matricule = Section.Matricule
AND Employe.Soc = Section.Soc
LEFT JOIN dbo.ListeSections
ON ListeSocietes.Soc = ListeSections.Soc
AND Section.Soc = ListeSections.Soc
AND Section.Code = ListeSections.Code
LEFT JOIN dbo.Classification
ON Employe.Matricule = Classification.Matricule
AND Employe.Soc = Classification.Soc
LEFT JOIN dbo.ListeClassifications
ON ListeSocietes.Soc = ListeClassifications.Soc
AND Classification.Soc = ListeClassifications.Soc
AND Classification.Code = ListeClassifications.Code
LEFT JOIN dbo.Statut
ON Employe.Matricule = Statut.Matricule
AND Employe.Soc = Statut.Soc
LEFT JOIN dbo.Pole_Technologique
ON Employe.Matricule = Pole_Technologique.Matricule
AND Employe.Soc = Pole_Technologique.Soc
LEFT JOIN dbo.Site
ON Employe.Matricule = Site.Matricule
AND Employe.Soc = Site.Soc
LEFT JOIN dbo.Contrat
ON Employe.Matricule = Contrat.Matricule
AND Employe.Soc = Contrat.Soc
LEFT JOIN dbo.Responsable
ON Employe.Matricule = Responsable.Matricule
AND Employe.Soc = Responsable.Soc
LEFT JOIN dbo.ListeResponsables
ON ListeSocietes.Soc = ListeResponsables.Soc
AND Responsable.Soc = ListeResponsables.Soc
AND Responsable.idResponsable = ListeResponsables.id
LEFT JOIN dbo.Activite
ON Employe.Matricule = Activite.Matricule
AND Employe.Soc = Activite.Soc
WHERE
(
Etablissement.DatePeriode = '20100101'
AND Section.DatePeriode = '20100101'
AND Classification.DatePeriode = '20100101'
AND Statut.DatePeriode = '20100101'
AND Pole_Technologique.DatePeriode = '20100101'
AND Site.DatePeriode = '20100101'
AND Contrat.DatePeriode = '20100101'
AND Responsable.DatePeriode = '20100101'
AND Activite.DatePeriode = '20100101'
) |
Partager