IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Développement SQL Server Discussion :

requete SQL SUM d'une Sum


Sujet :

Développement SQL Server

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre éclairé
    Profil pro
    Inscrit en
    Octobre 2006
    Messages
    829
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2006
    Messages : 829
    Par défaut requete SQL SUM d'une Sum
    bonjour à tous,


    Je dipose d'une requete sql que j'ai "simplifié" j'ai enlevé les champs qui ne m'intessessait pas .

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
     
     
     SELECT (select coalesce (sum (ttotfichado.Tiempopasado),0)
         from  ttotfichado
         where ttotfichado.hayabono<> 1 and
               (NOT (ttOTFichado.RepartoPendiente = 0 AND ttOTFichado.FichajeContraOT > 0) or ttOTFichado.RepartoPendiente IS NULL) AND
               ttOTIntervencion.Emp = ttOTFichado.Emp AND
               ttOTIntervencion.Numinterno = ttOTFichado.Numinterno AND  
               ttOTIntervencion.Intervencion = ttOTFichado.Intervencion and
               ttotfichado.fecha <= '12-1-2011 23:59:59.000') as tt,  
      Count(DISTINCT ttOTCab.NumOT),
      SUM(case tipocab
        when 0 then
          case tipolinea
            when 1 then
              case ttOTIntervencion.esabono
                when 1 then (-1 * ttotlinea.PrecioCosteMedio * coalesce (ttotcargolinea.cantidadhoras,ttotlinea.cantidadhoras))
                else             (ttotlinea.PrecioCosteMedio * coalesce (ttotcargolinea.cantidadhoras,ttotlinea.cantidadhoras))
              end
            else 0
          end	
        else 0
      end) as ImpPCPMrec,
      tgtaller.descrip as atelier,
      tgempresa.razon as societe
     
    FROM ttoTCab
     
      inner join tgempresa on
      ttotcab.emp = tgempresa.emp 
     
      inner join tgtaller on
      ttotcab.emp = tgtaller.emp and ttotcab.taller = tgtaller.taller
     
      INNER JOIN ttOTIntervencion ON 
      ttOTCab.Emp = ttOTIntervencion.Emp AND 
      ttOTCab.NumInterno = ttOTIntervencion.Numinterno 
     
      INNER JOIN ttOTLinea ON 
      ttOTIntervencion.Emp = ttOTLinea.Emp AND 
      ttOTIntervencion.Numinterno = ttOTLinea.NumIntOT AND 
      ttOTIntervencion.Intervencion = ttOTLinea.NumIntIntervencion 
     
      INNER JOIN ttSeccion ON 
      ttOTCab.Seccion = ttSeccion.Seccion 
     
      INNER JOIN ttSeccion seccion ON 
      ttOTIntervencion.Seccion = seccion.Seccion 
     
      LEFT OUTER JOIN TTrecepcionista ON
      ttOtCab.emp = TTrecepcionista.emp and
      ttOtCab.taller = TTrecepcionista.taller and 
      ttOtCab.recepcionista = TTrecepcionista.recepcionista
     
      LEFT OUTER JOIN Tgmarca ON
      ttOtCab.marca = tgmarca.marca
     
      LEFT OUTER JOIN ttOTCargoLinea ON 
      ttOTLinea.Emp = ttOTCargoLinea.Emp AND
      ttOTLinea.NumIntOT = ttOTCargoLinea.NumIntOT AND 
      ttOTLinea.NumIntIntervencion = ttOTCargoLinea.NumIntIntervencion AND
      ttOTLinea.LineaItem = ttOTCargoLinea.LineaItem 
     
      LEFT OUTER JOIN ttOTCargoInt on
      ttOTCargoLinea.Emp = ttotcargoint.emp AND
      ttOTCargoLinea.NumIntOT = ttotcargoint.Numintot AND 
      ttOTCargoLinea.NumIntIntervencion = ttotcargoint.numintintervencion AND
      ttOTCargoLinea.NumIntcargo = ttotcargoint.numintcargo 
     
      LEFT OUTER JOIN ttotcargo on
      ttotcargoint.emp=ttotcargo.emp and 
      ttotcargoint.NumIntOT=ttotcargo.NumInterno and
      ttotcargoint.NumIntCargo=ttotcargo.Cargo 
     
      LEFT OUTER JOIN ttgrupocargo on
      ttOTCargo.grupocargo = ttgrupocargo.grupo
     
      LEFT OUTER JOIN tgGrupoCont ON 
      ttOTLinea.GrupoCont = tgGrupoCont.GrupoCont
     
      LEFT OUTER JOIN tgMarca MarcaLinea ON 
      ttOTLinea.Marca = MarcaLinea.Marca
     
      LEFT OUTER JOIN tacategoriapieza ON	
      ttotlinea.marca = tacategoriapieza.marca and ttotlinea.codigocategoria 	= tacategoriapieza.codigo
     
      LEFT OUTER JOIN ttotstatus 	  ON ttOTCab.statusencurso = ttotstatus.Codigo
     
    WHERE   
       (ttotcab.emp='002' ) and  
    	(ttotintervencion.hayfactura = 0 ) and
    	(ttotcab.taller='20' ) and  
    	(ttOTCab.Anulada = 0) and 
    	(ttOTLinea.Anulada = 0) AND 
       (ttOTCab.FechaAperturaOT <= '12-1-2011 23:59:59.000' ) AND  
    	(
    	   ttOTLinea.FechaAlta <= '12-1-2011 23:59:59.000'
    		or ttotlinea.tipocab =1
    	) and 	
    	(ttotlinea.tipocab <> 2) and 
       (ttOTCab.Status = 30 )  and
    (ttotlinea.cantidadhoras <> 0 or ttotlinea.almservido <> 1)
    group by tgempresa.razon, tgtaller.descrip, ttOTIntervencion.Emp, ttOTIntervencion.Numinterno,  ttOTIntervencion.Intervencion
    Ci-dessus ma requete.

    J'arrive a récupérer le nom entreprise , atelier, plus le nombre de ligne (count).

    Mais je n'arrive pas faire une somme d'une somme.

    Ci-dessous la partie de la requête qui m'intéresser:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
     
     (select coalesce (sum (ttotfichado.Tiempopasado),0)
         from  ttotfichado
         where ttotfichado.hayabono<> 1 and
               (NOT (ttOTFichado.RepartoPendiente = 0 AND ttOTFichado.FichajeContraOT > 0) or ttOTFichado.RepartoPendiente IS NULL) AND
               ttOTIntervencion.Emp = ttOTFichado.Emp AND
               ttOTIntervencion.Numinterno = ttOTFichado.Numinterno AND  
               ttOTIntervencion.Intervencion = ttOTFichado.Intervencion and
               ttotfichado.fecha <= '12-1-2011 23:59:59.000') as tt,
    Ceci fait la somme dans une table. Et ce que je voudrait c'est la somme de cette somme. pour que cela sort comme ceci:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    entreprise1|atelier|nbr 88| Somme total.
    Alors que la actuellement cela sort comme ceci:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    entreprise1|atelier1|nbr 1| som1
    entreprise1|atelier1|nbr 1| som2
    entreprise1|atelier1|nbr 1| som3
    entreprise1|atelier1|nbr 1| som4
    entreprise1|atelier1|nbr 1| som5
    etc...
    Comment réaliser ceci?

    Merci d'avance pour votre aide

    guigui69

  2. #2
    Membre Expert Avatar de iberserk
    Homme Profil pro
    Architecte de base de données
    Inscrit en
    Novembre 2004
    Messages
    1 795
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Architecte de base de données
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Novembre 2004
    Messages : 1 795
    Par défaut
    Votre requète n'est pas aisée à decrypter mais vous groupez sur tgempresa.razon, tgtaller.descrip, ttOTIntervencion.Emp, ttOTIntervencion.Numinterno, ttOTIntervencion.Intervencion
    et vous n'avez pas tout ces champs dans le select...

    Testez en ne laissant que atelier et société dans votre group by?

  3. #3
    Membre éclairé
    Profil pro
    Inscrit en
    Octobre 2006
    Messages
    829
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2006
    Messages : 829
    Par défaut
    En enlevant "ttOTIntervencion.Emp, ttOTIntervencion.Numinterno, ttOTIntervencion.Intervencion" J'ai ceci comme message d'erreur:

    Serveur*: Msg 8120, Niveau 16, État 1, Ligne 1
    La colonne 'ttOTIntervencion.Emp' n'est pas valide dans la liste de sélection parce qu'elle n'est pas contenue dans une fonction d'agrégation ou dans la clause GROUP BY.
    Serveur*: Msg 8120, Niveau 16, État 1, Ligne 1
    La colonne 'ttOTIntervencion.Numinterno' n'est pas valide dans la liste de sélection parce qu'elle n'est pas contenue dans une fonction d'agrégation ou dans la clause GROUP BY.
    Serveur*: Msg 8120, Niveau 16, État 1, Ligne 1
    La colonne 'ttOTIntervencion.Intervencion' n'est pas valide dans la liste de sélection parce qu'elle n'est pas contenue dans une fonction d'agrégation ou dans la clause GROUP BY.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
     
    SELECT (SELECT coalesce (sum (ttotfichado.Tiempopasado),0)
         FROM  ttotfichado
         WHERE ttotfichado.hayabono<> 1 AND
               (NOT (ttOTFichado.RepartoPendiente = 0 AND ttOTFichado.FichajeContraOT > 0) OR ttOTFichado.RepartoPendiente IS NULL) AND
               ttOTIntervencion.Emp = ttOTFichado.Emp AND
               ttOTIntervencion.Numinterno = ttOTFichado.Numinterno AND  
               ttOTIntervencion.Intervencion = ttOTFichado.Intervencion AND
               ttotfichado.fecha <= '12-1-2011 23:59:59.000') AS tt,  
      Count(DISTINCT ttOTCab.NumOT),
      SUM(case tipocab
        when 0 then
          case tipolinea
            when 1 then
              case ttOTIntervencion.esabono
                when 1 then (-1 * ttotlinea.PrecioCosteMedio * coalesce (ttotcargolinea.cantidadhoras,ttotlinea.cantidadhoras))
                else             (ttotlinea.PrecioCosteMedio * coalesce (ttotcargolinea.cantidadhoras,ttotlinea.cantidadhoras))
              end
            else 0
          end	
        else 0
      end) AS ImpPCPMrec,
      tgtaller.descrip AS atelier,
      tgempresa.razon AS societe
     
    FROM ttoTCab
     
      INNER JOIN tgempresa ON
      ttotcab.emp = tgempresa.emp 
     
      INNER JOIN tgtaller ON
      ttotcab.emp = tgtaller.emp AND ttotcab.taller = tgtaller.taller
     
      INNER JOIN ttOTIntervencion ON 
      ttOTCab.Emp = ttOTIntervencion.Emp AND 
      ttOTCab.NumInterno = ttOTIntervencion.Numinterno 
     
      INNER JOIN ttOTLinea ON 
      ttOTIntervencion.Emp = ttOTLinea.Emp AND 
      ttOTIntervencion.Numinterno = ttOTLinea.NumIntOT AND 
      ttOTIntervencion.Intervencion = ttOTLinea.NumIntIntervencion 
     
      INNER JOIN ttSeccion ON 
      ttOTCab.Seccion = ttSeccion.Seccion 
     
      INNER JOIN ttSeccion seccion ON 
      ttOTIntervencion.Seccion = seccion.Seccion 
     
      LEFT OUTER JOIN TTrecepcionista ON
      ttOtCab.emp = TTrecepcionista.emp AND
      ttOtCab.taller = TTrecepcionista.taller AND 
      ttOtCab.recepcionista = TTrecepcionista.recepcionista
     
      LEFT OUTER JOIN Tgmarca ON
      ttOtCab.marca = tgmarca.marca
     
      LEFT OUTER JOIN ttOTCargoLinea ON 
      ttOTLinea.Emp = ttOTCargoLinea.Emp AND
      ttOTLinea.NumIntOT = ttOTCargoLinea.NumIntOT AND 
      ttOTLinea.NumIntIntervencion = ttOTCargoLinea.NumIntIntervencion AND
      ttOTLinea.LineaItem = ttOTCargoLinea.LineaItem 
     
      LEFT OUTER JOIN ttOTCargoInt ON
      ttOTCargoLinea.Emp = ttotcargoint.emp AND
      ttOTCargoLinea.NumIntOT = ttotcargoint.Numintot AND 
      ttOTCargoLinea.NumIntIntervencion = ttotcargoint.numintintervencion AND
      ttOTCargoLinea.NumIntcargo = ttotcargoint.numintcargo 
     
      LEFT OUTER JOIN ttotcargo ON
      ttotcargoint.emp=ttotcargo.emp AND 
      ttotcargoint.NumIntOT=ttotcargo.NumInterno AND
      ttotcargoint.NumIntCargo=ttotcargo.Cargo 
     
      LEFT OUTER JOIN ttgrupocargo ON
      ttOTCargo.grupocargo = ttgrupocargo.grupo
     
      LEFT OUTER JOIN tgGrupoCont ON 
      ttOTLinea.GrupoCont = tgGrupoCont.GrupoCont
     
      LEFT OUTER JOIN tgMarca MarcaLinea ON 
      ttOTLinea.Marca = MarcaLinea.Marca
     
      LEFT OUTER JOIN tacategoriapieza ON	
      ttotlinea.marca = tacategoriapieza.marca AND ttotlinea.codigocategoria 	= tacategoriapieza.codigo
     
      LEFT OUTER JOIN ttotstatus 	  ON ttOTCab.statusencurso = ttotstatus.Codigo
     
    WHERE   
       (ttotcab.emp='002' ) AND  
    	(ttotintervencion.hayfactura = 0 ) AND
    	(ttotcab.taller='20' ) AND  
    	(ttOTCab.Anulada = 0) AND 
    	(ttOTLinea.Anulada = 0) AND 
       (ttOTCab.FechaAperturaOT <= '12-1-2011 23:59:59.000' ) AND  
    	(
    	   ttOTLinea.FechaAlta <= '12-1-2011 23:59:59.000'
    		OR ttotlinea.tipocab =1
    	) AND 	
    	(ttotlinea.tipocab <> 2) AND 
       (ttOTCab.STATUS = 30 )  AND
    (ttotlinea.cantidadhoras <> 0 OR ttotlinea.almservido <> 1)
    GROUP BY tgempresa.razon, tgtaller.descrip
    guigui69

  4. #4
    Membre éclairé
    Profil pro
    Inscrit en
    Octobre 2006
    Messages
    829
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2006
    Messages : 829
    Par défaut
    Voila ce que me retourne ka requete normalement:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
     
    (SELECT coalesce (sum (ttotfichado.Tiempopasado),0)
         FROM  ttotfichado
         WHERE ttotfichado.hayabono<> 1 AND
               (NOT (ttOTFichado.RepartoPendiente = 0 AND ttOTFichado.FichajeContraOT > 0) OR ttOTFichado.RepartoPendiente IS NULL) AND
               ttOTIntervencion.Emp = ttOTFichado.Emp AND
               ttOTIntervencion.Numinterno = ttOTFichado.Numinterno AND  
               ttOTIntervencion.Intervencion = ttOTFichado.Intervencion AND
               ttotfichado.fecha <= '12-1-2011 23:59:59.000') AS tt,
    Voila le resultat:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
     
    8.2100
    38.7400
    .3500
    .3200
    4.4100
    .5000
    .0000
    2.1300
    1.5300
    8.2100
    38.7400
    .8300
    .0000
    4.4100
    8.2100
    38.7400
    2.1300
    3.3500
    8.2100
    38.7400
    5.1100
    .0000
    4.4100
    8.2100
    38.7400
    2.1300
    3.3500
    4.4100
    38.7400
    5.1100
    .2800
    .0000
    4.9400
    8.2100
    38.7400
    3.3500
    2.1400
    4.4100
    38.7400
    5.1100
    .9800
    .0000
    4.9400
    8.2100
    38.7400
    3.2600
    .0000
    4.4100
    38.7400
    5.1100
    .9800
    .0000
    4.9400
    8.2100
    3.2600
    38.7400
    2.8800
    4.4100
    38.7400
    5.1100
    .9800
    .0000
    4.9400
    8.2100
    .0000
    38.7400
    .3200
    4.4100
    38.7400
    .0000
    2.1300
    .0000
    Et ce que je voudrait c'est la somme de tout ca.

    Désolé si je ne suis pas clair dans mon explication.

    Guigui69

  5. #5
    Modérateur

    Profil pro
    dba
    Inscrit en
    Janvier 2010
    Messages
    5 643
    Détails du profil
    Informations personnelles :
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : dba

    Informations forums :
    Inscription : Janvier 2010
    Messages : 5 643
    Par défaut
    Pas très clair en effet...

    Veux-tu cette somme pour chaque ligne de résultat ? dans ce cas enlève la corrélation entre la sous requête et la requête principale. En plus ta requête n'en sera que plus rapide !

    Si tu veux garder les sous-totaux, mais calculer à la fin le total global, tu peux mettre quelque chose comme :

    Code SQL : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    COMPUTE SUM(tt)

    à la fin de ta requête...

    Un petit jeu de données, et surtout le résultat attendu nous aiderait a comprendre...

  6. #6
    Rédacteur

    Avatar de SQLpro
    Homme Profil pro
    Expert bases de données / SQL / MS SQL Server / Postgresql
    Inscrit en
    Mai 2002
    Messages
    21 998
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Var (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Expert bases de données / SQL / MS SQL Server / Postgresql
    Secteur : Conseil

    Informations forums :
    Inscription : Mai 2002
    Messages : 21 998
    Billets dans le blog
    6
    Par défaut
    Surtout que COMPUTE est désaprouvé et sera retirée...
    Utilisez éventuellement CUBE ou ROLLUP, sinon une sous requête en table dérivée, ou mieux, une CTE.

    A +
    Frédéric Brouard - SQLpro - ARCHITECTE DE DONNÉES - expert SGBDR et langage SQL
    Le site sur les SGBD relationnels et le langage SQL: http://sqlpro.developpez.com/
    Blog SQL, SQL Server, SGBDR : http://blog.developpez.com/sqlpro
    Expert Microsoft SQL Server - M.V.P. (Most valuable Professional) MS Corp.
    Entreprise SQL SPOT : modélisation, conseils, audit, optimisation, formation...
    * * * * * Expertise SQL Server : http://mssqlserver.fr/ * * * * *

  7. #7
    Modérateur

    Homme Profil pro
    Administrateur de base de données
    Inscrit en
    Janvier 2005
    Messages
    5 826
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Administrateur de base de données
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Janvier 2005
    Messages : 5 826
    Par défaut
    Ni les CTE, donc on doit revenir à :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    SELECT	societe
    	, atelier
    	, SUM(somme) AS final_somme
    FROM	(
    		SELECT		(
    					SELECT		COALESCE (SUM(F.Tiempopasado), 0)
    					FROM		dbo.ttotfichado AS F
    					INNER JOIN	dbo.ttOTIntervencion AS I 
    								ON I.Emp = F.Emp
    								AND I.Intervencion = F.Intervencion
    					WHERE		F.hayabono <> 1
    					AND		(
    								NOT (
    									F.RepartoPendiente = 0
    									AND F.FichajeContraOT > 0
    								)
    								OR F.RepartoPendiente IS NULL
    							)
    					AND		I.Numinterno = F.Numinterno
    					AND		F.fecha <= '12-1-2011 23:59:59.000'
    				) AS somme
    				, COUNT(DISTINCT TCab.NumOT)
    				, SUM
    				(
    					CASE L.tipocab
    						WHEN 0 THEN CASE L.tipolinea
    									WHEN 1 THEN CASE I.esabono
    											WHEN 1 THEN (-1 * L.PrecioCosteMedio * COALESCE(CL.cantidadhoras, L.cantidadhoras))
    											ELSE L.PrecioCosteMedio * COALESCE(CL.cantidadhoras, L.cantidadhoras)
    										END
    									ELSE 0
    							END	
    						ELSE 0
    					END
    				) AS ImpPCPMrec,
    				, T.descrip AS atelier
    				, E.razon AS societe  
    		FROM		dbo.ttotcab AS TCab
    		INNER JOIN	dbo.tgempresa AS E
    					ON TCab.emp = E.emp 
    		INNER JOIN	dbo.tgtaller AS T
    					ON TCab.emp = T.emp 
    					AND TCab.taller = T.taller
    		INNER JOIN	dbo.ttOTIntervencion AS I
    					ON TCab.Emp = I.Emp
    					AND TCab.NumInterno = I.Numinterno 
    		INNER JOIN	dbo.ttOTLinea AS L
    					ON I.Emp = L.Emp 
    					AND I.Numinterno = L.NumIntOT 
    					AND I.Intervencion = L.NumIntIntervencion 
    		INNER JOIN	dbo.ttSeccion AS S1
    					ON TCab.Seccion = S1.Seccion 
    		INNER JOIN	dbo.ttSeccion AS S2
    					ON I.Seccion = S2.Seccion 
    		LEFT JOIN	dbo.TTrecepcionista AS R
    					ON TCab.emp = R.emp 
    					AND TCab.taller = R.taller 
    					AND TCab.recepcionista = R.recepcionista
    		LEFT JOIN	dbo.Tgmarca AS M
    					ON TCab.marca = M.marca
    					AND L.Marca = M.Marca
    		LEFT JOIN	dbo.ttOTCargoLinea AS CL
    					ON L.Emp = CL.Emp
    					AND L.NumIntOT = CL.NumIntOT 
    					AND L.NumIntIntervencion = CL.NumIntIntervencion 
    					AND L.LineaItem = CL.LineaItem 
    		LEFT JOIN	dbo.ttOTCargoInt AS CI
    					ON CL.Emp = CI.emp
    					AND CL.NumIntOT = CI.Numintot
    					AND CL.NumIntIntervencion = CI.numintintervencion 
    					AND CL.NumIntcargo = CI.numintcargo 
    		LEFT JOIN	dbo.ttotcargo AS C
    					ON CI.emp = C.emp
    					AND CI.NumIntOT = C.NumInterno 
    					AND CI.NumIntCargo = C.Cargo 
    		LEFT JOIN	dbo.ttgrupocargo GC 
    					ON C.grupocargo = GC.grupo
    		LEFT JOIN	dbo.tgGrupoCont AS GCT
    					ON L.GrupoCont = GCT.GrupoCont
    		LEFT JOIN	dbo.tacategoriapieza CP
    					ON L.marca = CP.marca
    					AND L.codigocategoria = CP.codigo
    		LEFT JOIN	dbo.ttotstatus AS S
    					ON TCab.statusencurso = S.Codigo
    		WHERE		TCab.emp = '002'
    		AND		I.hayfactura = 0
    		AND		TCab.taller = '20'
    		AND		TCab.Anulada = 0
    		AND		L.Anulada = 0
    		AND		TCab.FechaAperturaOT <= '12-1-2011 23:59:59.000'
    		AND		(
    					L.FechaAlta <= '12-1-2011 23:59:59.000'
    					OR L.tipocab = 1
    				)
    		AND 		L.tipocab <> 2
    		AND		TCab.STATUS = 30 
    		AND		(
    					L.cantidadhoras <> 0
    					OR L.almservido <> 1
    				)
    		GROUP BY	G.razon, T.descrip
    	)
    GROUP	BY societe, atelier
    Cherchez un peu !
    En outre, si vous aviez respecté la charte de postage de ce forum, en particulier :

    Créer un nouveau post

    Le sujet

    Commencez en spécifiant la version utilisée
    Vous n'auriez pas perdu votre temps, et nous non plus par la même occasion !

    @++

  8. #8
    Membre éclairé
    Profil pro
    Inscrit en
    Octobre 2006
    Messages
    829
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2006
    Messages : 829
    Par défaut
    Ah, je suis vraiment désolé

    Je regarde la regarde la requete et je reply

    guigui69

  9. #9
    Membre éclairé
    Profil pro
    Inscrit en
    Octobre 2006
    Messages
    829
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2006
    Messages : 829
    Par défaut
    Bonjour,

    Je me suis mi pendant 1heure sur la requête mais j'ai un message d'erreur pas rapport au GROUP
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
     
    SELECT	societe
    	, atelier
    	, SUM(somme) AS final_somme
    FROM	(
    		SELECT		(
    					SELECT		COALESCE (SUM(F.Tiempopasado), 0)
    					FROM		dbo.ttotfichado AS F
    					INNER JOIN	dbo.ttOTIntervencion AS I 
    								ON I.Emp = F.Emp
    								AND I.Intervencion = F.Intervencion
    					WHERE		F.hayabono <> 1
    					AND		(
    								NOT (
    									F.RepartoPendiente = 0
    									AND F.FichajeContraOT > 0
    								)
    								OR F.RepartoPendiente IS NULL
    							)
    					AND		I.Numinterno = F.Numinterno
    					AND		F.fecha <= '12-1-2011 23:59:59.000'
    				) AS somme
    				, COUNT(DISTINCT TCab.NumOT)
    				, SUM
    				(
    					CASE L.tipocab
    						WHEN 0 THEN CASE L.tipolinea
    									WHEN 1 THEN CASE I.esabono
    											WHEN 1 THEN (-1 * L.PrecioCosteMedio * COALESCE(CL.cantidadhoras, L.cantidadhoras))
    											ELSE L.PrecioCosteMedio * COALESCE(CL.cantidadhoras, L.cantidadhoras)
    										END
    									ELSE 0
    							END	
    						ELSE 0
    					END
    				) AS ImpPCPMrec,
    				 T.descrip AS atelier
    				, E.razon AS societe  
    		FROM		dbo.ttotcab AS TCab
    		INNER JOIN	dbo.tgempresa AS E
    					ON TCab.emp = E.emp 
    		INNER JOIN	dbo.tgtaller AS T
    					ON TCab.emp = T.emp 
    					AND TCab.taller = T.taller
    		INNER JOIN	dbo.ttOTIntervencion AS I
    					ON TCab.Emp = I.Emp
    					AND TCab.NumInterno = I.Numinterno 
    		INNER JOIN	dbo.ttOTLinea AS L
    					ON I.Emp = L.Emp 
    					AND I.Numinterno = L.NumIntOT 
    					AND I.Intervencion = L.NumIntIntervencion 
    		INNER JOIN	dbo.ttSeccion AS S1
    					ON TCab.Seccion = S1.Seccion 
    		INNER JOIN	dbo.ttSeccion AS S2
    					ON I.Seccion = S2.Seccion 
    		LEFT JOIN	dbo.TTrecepcionista AS R
    					ON TCab.emp = R.emp 
    					AND TCab.taller = R.taller 
    					AND TCab.recepcionista = R.recepcionista
    		LEFT JOIN	dbo.Tgmarca AS M
    					ON TCab.marca = M.marca
    					AND L.Marca = M.Marca
    		LEFT JOIN	dbo.ttOTCargoLinea AS CL
    					ON L.Emp = CL.Emp
    					AND L.NumIntOT = CL.NumIntOT 
    					AND L.NumIntIntervencion = CL.NumIntIntervencion 
    					AND L.LineaItem = CL.LineaItem 
    		LEFT JOIN	dbo.ttOTCargoInt AS CI
    					ON CL.Emp = CI.emp
    					AND CL.NumIntOT = CI.Numintot
    					AND CL.NumIntIntervencion = CI.numintintervencion 
    					AND CL.NumIntcargo = CI.numintcargo 
    		LEFT JOIN	dbo.ttotcargo AS C
    					ON CI.emp = C.emp
    					AND CI.NumIntOT = C.NumInterno 
    					AND CI.NumIntCargo = C.Cargo 
    		LEFT JOIN	dbo.ttgrupocargo GC 
    					ON C.grupocargo = GC.grupo
    		LEFT JOIN	dbo.tgGrupoCont AS GCT
    					ON L.GrupoCont = GCT.GrupoCont
    		LEFT JOIN	dbo.tacategoriapieza CP
    					ON L.marca = CP.marca
    					AND L.codigocategoria = CP.codigo
    		LEFT JOIN	dbo.ttotstatus AS S
    					ON TCab.statusencurso = S.Codigo
    		WHERE		TCab.emp = '002'
    		AND		I.hayfactura = 0
    		AND		TCab.taller = '20'
    		AND		TCab.Anulada = 0
    		AND		L.Anulada = 0
    		AND		TCab.FechaAperturaOT <= '12-1-2011 23:59:59.000'
    		AND		(
    					L.FechaAlta <= '12-1-2011 23:59:59.000'
    					OR L.tipocab = 1
    				)
    		AND 		L.tipocab <> 2
    		AND		TCab.STATUS = 30 
    		AND		(
    					L.cantidadhoras <> 0
    					OR L.almservido <> 1
    				)
    		GROUP BY	G.razon, T.descrip
    	)
    GROUP	BY societe, atelier
    Je suis sur qu'il a pas grand chose mais je ne vois pas quoi

    Synbtaxe incorrect vers le mot clé GROUP
    Je pense que c'est au niveau de celui ci: GROUP BY societe, atelier

    Ou se trouve l'erreur?

    guigui69

  10. #10
    Membre Expert Avatar de iberserk
    Homme Profil pro
    Architecte de base de données
    Inscrit en
    Novembre 2004
    Messages
    1 795
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Architecte de base de données
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Novembre 2004
    Messages : 1 795
    Par défaut
    Vous avez juste oublié de donner un nom à votre sous-table:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    		AND 		L.tipocab <> 2
    		AND		TCab.STATUS = 30 
    		AND		(
    					L.cantidadhoras <> 0
    					OR L.almservido <> 1
    				)
    		GROUP BY	G.razon, T.descrip
    	)  AS TableOubliee
    GROUP	BY societe, atelier

  11. #11
    Membre éclairé
    Profil pro
    Inscrit en
    Octobre 2006
    Messages
    829
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2006
    Messages : 829
    Par défaut
    Merci,

    j'ai regardé la requête elle me ressort un résultat étrange (19000 <== je ne suis pas arrivé à trouver a quoi cela correspond) alors que normalement je devrait trouver 394.

    Pour avancer, quelqu'un ma indiqué de créer une view, c'est ce que j'ai fait.

    Voici un exemple de la requête que j’insère dans la view:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
     
     
    CREATE VIEW as dbo.V_or_encours
     
     SELECT (SELECT coalesce (sum (ttotfichado.Tiempopasado),0)
         FROM  ttotfichado
         WHERE ttotfichado.hayabono<> 1 AND
               (NOT (ttOTFichado.RepartoPendiente = 0 AND ttOTFichado.FichajeContraOT > 0) OR ttOTFichado.RepartoPendiente IS NULL) AND
               ttOTIntervencion.Emp = ttOTFichado.Emp AND
               ttOTIntervencion.Numinterno = ttOTFichado.Numinterno AND  
               ttOTIntervencion.Intervencion = ttOTFichado.Intervencion AND
               ttotfichado.fecha <= '12-1-2011 23:59:59.000') AS tt,  
      Count(DISTINCT ttOTCab.NumOT),
      SUM(case tipocab
        when 0 then
          case tipolinea
            when 1 then
              case ttOTIntervencion.esabono
                when 1 then (-1 * ttotlinea.PrecioCosteMedio * coalesce (ttotcargolinea.cantidadhoras,ttotlinea.cantidadhoras))
                else             (ttotlinea.PrecioCosteMedio * coalesce (ttotcargolinea.cantidadhoras,ttotlinea.cantidadhoras))
              end
            else 0
          end	
        else 0
      end) AS ImpPCPMrec,
      tgtaller.descrip AS atelier,
      tgempresa.razon AS societe
     
    FROM ttoTCab
     
      INNER JOIN tgempresa ON
      ttotcab.emp = tgempresa.emp 
     
      INNER JOIN tgtaller ON
      ttotcab.emp = tgtaller.emp AND ttotcab.taller = tgtaller.taller
     
      INNER JOIN ttOTIntervencion ON 
      ttOTCab.Emp = ttOTIntervencion.Emp AND 
      ttOTCab.NumInterno = ttOTIntervencion.Numinterno 
     
      INNER JOIN ttOTLinea ON 
      ttOTIntervencion.Emp = ttOTLinea.Emp AND 
      ttOTIntervencion.Numinterno = ttOTLinea.NumIntOT AND 
      ttOTIntervencion.Intervencion = ttOTLinea.NumIntIntervencion 
     
      INNER JOIN ttSeccion ON 
      ttOTCab.Seccion = ttSeccion.Seccion 
     
      INNER JOIN ttSeccion seccion ON 
      ttOTIntervencion.Seccion = seccion.Seccion 
     
      LEFT OUTER JOIN TTrecepcionista ON
      ttOtCab.emp = TTrecepcionista.emp AND
      ttOtCab.taller = TTrecepcionista.taller AND 
      ttOtCab.recepcionista = TTrecepcionista.recepcionista
     
      LEFT OUTER JOIN Tgmarca ON
      ttOtCab.marca = tgmarca.marca
     
      LEFT OUTER JOIN ttOTCargoLinea ON 
      ttOTLinea.Emp = ttOTCargoLinea.Emp AND
      ttOTLinea.NumIntOT = ttOTCargoLinea.NumIntOT AND 
      ttOTLinea.NumIntIntervencion = ttOTCargoLinea.NumIntIntervencion AND
      ttOTLinea.LineaItem = ttOTCargoLinea.LineaItem 
     
      LEFT OUTER JOIN ttOTCargoInt ON
      ttOTCargoLinea.Emp = ttotcargoint.emp AND
      ttOTCargoLinea.NumIntOT = ttotcargoint.Numintot AND 
      ttOTCargoLinea.NumIntIntervencion = ttotcargoint.numintintervencion AND
      ttOTCargoLinea.NumIntcargo = ttotcargoint.numintcargo 
     
      LEFT OUTER JOIN ttotcargo ON
      ttotcargoint.emp=ttotcargo.emp AND 
      ttotcargoint.NumIntOT=ttotcargo.NumInterno AND
      ttotcargoint.NumIntCargo=ttotcargo.Cargo 
     
      LEFT OUTER JOIN ttgrupocargo ON
      ttOTCargo.grupocargo = ttgrupocargo.grupo
     
      LEFT OUTER JOIN tgGrupoCont ON 
      ttOTLinea.GrupoCont = tgGrupoCont.GrupoCont
     
      LEFT OUTER JOIN tgMarca MarcaLinea ON 
      ttOTLinea.Marca = MarcaLinea.Marca
     
      LEFT OUTER JOIN tacategoriapieza ON	
      ttotlinea.marca = tacategoriapieza.marca AND ttotlinea.codigocategoria 	= tacategoriapieza.codigo
     
      LEFT OUTER JOIN ttotstatus 	  ON ttOTCab.statusencurso = ttotstatus.Codigo
     
    WHERE   
       (ttotcab.emp='002' ) AND  
    	(ttotintervencion.hayfactura = 0 ) AND
    	(ttotcab.taller='20' ) AND  
    	(ttOTCab.Anulada = 0) AND 
    	(ttOTLinea.Anulada = 0) AND 
       (ttOTCab.FechaAperturaOT <= '12-1-2011 23:59:59.000' ) AND  
    	(
    	   ttOTLinea.FechaAlta <= '12-1-2011 23:59:59.000'
    		OR ttotlinea.tipocab =1
    	) AND 	
    	(ttotlinea.tipocab <> 2) AND 
       (ttOTCab.STATUS = 30 )  AND
    (ttotlinea.cantidadhoras <> 0 OR ttotlinea.almservido <> 1)
    GROUP BY tgempresa.razon, tgtaller.descrip, ttOTIntervencion.Emp, ttOTIntervencion.Numinterno,  ttOTIntervencion.Intervencion
     
    UNION ALL
     
     SELECT (SELECT coalesce (sum (ttotfichado.Tiempopasado),0)
         FROM  ttotfichado
         WHERE ttotfichado.hayabono<> 1 AND
               (NOT (ttOTFichado.RepartoPendiente = 0 AND ttOTFichado.FichajeContraOT > 0) OR ttOTFichado.RepartoPendiente IS NULL) AND
               ttOTIntervencion.Emp = ttOTFichado.Emp AND
               ttOTIntervencion.Numinterno = ttOTFichado.Numinterno AND  
               ttOTIntervencion.Intervencion = ttOTFichado.Intervencion AND
               ttotfichado.fecha <= '12-1-2011 23:59:59.000') AS tt,  
      Count(DISTINCT ttOTCab.NumOT),
      SUM(case tipocab
        when 0 then
          case tipolinea
            when 1 then
              case ttOTIntervencion.esabono
                when 1 then (-1 * ttotlinea.PrecioCosteMedio * coalesce (ttotcargolinea.cantidadhoras,ttotlinea.cantidadhoras))
                else             (ttotlinea.PrecioCosteMedio * coalesce (ttotcargolinea.cantidadhoras,ttotlinea.cantidadhoras))
              end
            else 0
          end	
        else 0
      end) AS ImpPCPMrec,
      tgtaller.descrip AS atelier,
      tgempresa.razon AS societe
     
    FROM ttoTCab
     
      INNER JOIN tgempresa ON
      ttotcab.emp = tgempresa.emp 
     
      INNER JOIN tgtaller ON
      ttotcab.emp = tgtaller.emp AND ttotcab.taller = tgtaller.taller
     
      INNER JOIN ttOTIntervencion ON 
      ttOTCab.Emp = ttOTIntervencion.Emp AND 
      ttOTCab.NumInterno = ttOTIntervencion.Numinterno 
     
      INNER JOIN ttOTLinea ON 
      ttOTIntervencion.Emp = ttOTLinea.Emp AND 
      ttOTIntervencion.Numinterno = ttOTLinea.NumIntOT AND 
      ttOTIntervencion.Intervencion = ttOTLinea.NumIntIntervencion 
     
      INNER JOIN ttSeccion ON 
      ttOTCab.Seccion = ttSeccion.Seccion 
     
      INNER JOIN ttSeccion seccion ON 
      ttOTIntervencion.Seccion = seccion.Seccion 
     
      LEFT OUTER JOIN TTrecepcionista ON
      ttOtCab.emp = TTrecepcionista.emp AND
      ttOtCab.taller = TTrecepcionista.taller AND 
      ttOtCab.recepcionista = TTrecepcionista.recepcionista
     
      LEFT OUTER JOIN Tgmarca ON
      ttOtCab.marca = tgmarca.marca
     
      LEFT OUTER JOIN ttOTCargoLinea ON 
      ttOTLinea.Emp = ttOTCargoLinea.Emp AND
      ttOTLinea.NumIntOT = ttOTCargoLinea.NumIntOT AND 
      ttOTLinea.NumIntIntervencion = ttOTCargoLinea.NumIntIntervencion AND
      ttOTLinea.LineaItem = ttOTCargoLinea.LineaItem 
     
      LEFT OUTER JOIN ttOTCargoInt ON
      ttOTCargoLinea.Emp = ttotcargoint.emp AND
      ttOTCargoLinea.NumIntOT = ttotcargoint.Numintot AND 
      ttOTCargoLinea.NumIntIntervencion = ttotcargoint.numintintervencion AND
      ttOTCargoLinea.NumIntcargo = ttotcargoint.numintcargo 
     
      LEFT OUTER JOIN ttotcargo ON
      ttotcargoint.emp=ttotcargo.emp AND 
      ttotcargoint.NumIntOT=ttotcargo.NumInterno AND
      ttotcargoint.NumIntCargo=ttotcargo.Cargo 
     
      LEFT OUTER JOIN ttgrupocargo ON
      ttOTCargo.grupocargo = ttgrupocargo.grupo
     
      LEFT OUTER JOIN tgGrupoCont ON 
      ttOTLinea.GrupoCont = tgGrupoCont.GrupoCont
     
      LEFT OUTER JOIN tgMarca MarcaLinea ON 
      ttOTLinea.Marca = MarcaLinea.Marca
     
      LEFT OUTER JOIN tacategoriapieza ON	
      ttotlinea.marca = tacategoriapieza.marca AND ttotlinea.codigocategoria 	= tacategoriapieza.codigo
     
      LEFT OUTER JOIN ttotstatus 	  ON ttOTCab.statusencurso = ttotstatus.Codigo
     
    WHERE   
       (ttotcab.emp='002' ) AND  
    	(ttotintervencion.hayfactura = 0 ) AND
    	(ttotcab.taller='20' ) AND  
    	(ttOTCab.Anulada = 0) AND 
    	(ttOTLinea.Anulada = 0) AND 
       (ttOTCab.FechaAperturaOT <= '12-1-2011 23:59:59.000' ) AND  
    	(
    	   ttOTLinea.FechaAlta <= '12-1-2011 23:59:59.000'
    		OR ttotlinea.tipocab =1
    	) AND 	
    	(ttotlinea.tipocab <> 2) AND 
       (ttOTCab.STATUS = 30 )  AND
    (ttotlinea.cantidadhoras <> 0 OR ttotlinea.almservido <> 1)
    GROUP BY tgempresa.razon, tgtaller.descrip, ttOTIntervencion.Emp, ttOTIntervencion.Numinterno,  ttOTIntervencion.Intervencion
    J'interroge la table en utilisant PHP à travers un WAMP, mais j'ai un fonctionnement bizarre.


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    select societe, atelier, sum(tt) or, count(nor) as nor
    FROM dbo.V_or_encours
    GROUP BY societe atelier


    Mais 1/3 cela me retourne pas de résultat dans page web, Je doit faire un refresh de la page (2x) pour avoir le résultat.

    Quand je regarde le code source de la page quand cela bug c'est au niveau de l'envoi de requête.




    Ou peut se trouver le problème? Ma requête est trop lourd?

    (Désolé si se n'ai pas la bonne section, je ne sais pas quelle partie cela concerne)

    guigui69

Discussions similaires

  1. Requete SQL pour réaliser une SUM
    Par guigui69 dans le forum Langage SQL
    Réponses: 4
    Dernier message: 14/03/2011, 18h31
  2. [Requete SQL] Hierarchie dans une meme table
    Par jowsuket dans le forum Langage SQL
    Réponses: 4
    Dernier message: 21/08/2009, 21h11
  3. requete sql : calcul d'une moyenne
    Par timide94 dans le forum Requêtes et SQL.
    Réponses: 3
    Dernier message: 16/01/2007, 19h12
  4. requete SQL multichamps/dans une liste de valeur
    Par maxidoove dans le forum Langage SQL
    Réponses: 2
    Dernier message: 28/07/2006, 15h48
  5. Comment executer une requete sql delete dans une jsp ?
    Par DarkWark dans le forum Servlets/JSP
    Réponses: 3
    Dernier message: 24/05/2006, 16h59

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo