Requête difficile

Résolu
cs_othinakiway Messages postés 30 Date d'inscription lundi 7 avril 2008 Statut Membre Dernière intervention 10 juin 2009 - 8 juin 2009 à 02:50
cs_othinakiway Messages postés 30 Date d'inscription lundi 7 avril 2008 Statut Membre Dernière intervention 10 juin 2009 - 9 juin 2009 à 20:33
A partir du schéma relationnelle suivante :
Entreprise(RS, tel, adresse, fax ...#codeP, #codeS)
Secteur(codeS,#nomS)
Branche(codeB,nomB,#codeS)
Région(codeR,nomR)
Province(codeP,nomP,#codeR)
Besoin_emploi(#RS,#codeM,Annee,Trimestre,nbr_effectif)
Besoin_formation(#RS,#codeM,domaine,nbr_effectif)

on veut avoir le besoin en emploi par Emploi-Métier sur le moyen terme , sachant que l'étude s'étale sur 3 années , prenant 2009 comme année de démarrage de l'étude cela donne court terme=(T1/2009 et T2/2009)  et moyen terme=(de T3/2009 jusqu'à T4/2011)

pour réaliser cela j'ai procédé ainsi:
select MT.nomM, sum(nbr_effectif)-(select  sum(nbr_effectif) as total from besoin_emploi BE,entreprise E, branche B, métier M, province P, région R
where BE.codeM=M.codeM and M.codeb=B.codeB and BE.RS=E.RS and E.codeP=P.codeP and P.codeR=R.codeR and B.codeB=@codeBranche and R.codeR=@codeRégion and annee=@annee and trimestre in ('T1','T2') group by M.nomM having M.nomM=MT.nomM) as total from besoin_emploi BE,entreprise E, branche B, métier MT, province P, région R
where BE.codeM=MT.codeM and MT.codeb=B.codeB and BE.RS=E.RS and E.codeP=P.codeP and P.codeR=R.codeR and B.codeB=@codeBranche and R.codeR=@codeRégion  group by MT.nomM

mais cela produit malheureusement une résultat érroné.
 je vous remercie de me proposer une solution à mon problème, c trés urgent.

1 réponse

cs_othinakiway Messages postés 30 Date d'inscription lundi 7 avril 2008 Statut Membre Dernière intervention 10 juin 2009 2
9 juin 2009 à 20:33
finalement, j'ai trouvé la réponse merci quand même pour votre soutient :D .
3
Rejoignez-nous