A voir également:
- Requete sql résultat en colonnes
- Word colonnes indépendantes - Guide
- Lexer resultat - Télécharger - Sport
- Blob sql ✓ - Forum Webmastering
- Casio fx 92 resultat sans fraction ✓ - Forum calculatrices
- Récupération serveur sql - Télécharger - Gestion de données
4 réponses
Bon, j'en ai fait une autre qui donne les mêmes genres de résultats :
SELECT TOP 100 PERCENT dbo.F_DOCLIGNE.CT_Num, dbo.F_DOCLIGNE.DL_Remise01REM_Valeur, dbo.F_ARTICLE.FA_CodeFamille,
SUM(dbo.F_DOCLIGNE.DL_MontantHT) AS Expr1
FROM dbo.F_DOCLIGNE INNER JOIN
dbo.F_ARTICLE ON dbo.F_DOCLIGNE.AR_Ref = dbo.F_ARTICLE.AR_Ref
GROUP BY dbo.F_DOCLIGNE.DO_Type, dbo.F_DOCLIGNE.CT_Num, dbo.F_DOCLIGNE.DL_Remise01REM_Valeur, dbo.F_ARTICLE.FA_CodeFamille
HAVING (dbo.F_DOCLIGNE.DO_Type = 6)
ORDER BY dbo.F_DOCLIGNE.CT_Num
C'est mieux, non ?
SELECT TOP 100 PERCENT dbo.F_DOCLIGNE.CT_Num, dbo.F_DOCLIGNE.DL_Remise01REM_Valeur, dbo.F_ARTICLE.FA_CodeFamille,
SUM(dbo.F_DOCLIGNE.DL_MontantHT) AS Expr1
FROM dbo.F_DOCLIGNE INNER JOIN
dbo.F_ARTICLE ON dbo.F_DOCLIGNE.AR_Ref = dbo.F_ARTICLE.AR_Ref
GROUP BY dbo.F_DOCLIGNE.DO_Type, dbo.F_DOCLIGNE.CT_Num, dbo.F_DOCLIGNE.DL_Remise01REM_Valeur, dbo.F_ARTICLE.FA_CodeFamille
HAVING (dbo.F_DOCLIGNE.DO_Type = 6)
ORDER BY dbo.F_DOCLIGNE.CT_Num
C'est mieux, non ?
Utilisateur anonyme
23 mai 2008 à 11:28
23 mai 2008 à 11:28
On pourrait voir ta requête stp ?
SELECT TOP 100 PERCENT Num_Compte, Tx_Remise, FA_CodeFamille, SUM(Mt_Brut_Facture - ROUND(Mt_Brut_Facture * (Tx_Remise / 100), 2))
AS Mt_CA_Net_Facture
FROM (SELECT Idf_CIP AS Code_CIP_Officine, CT_intitule + '(' + CT_contact + ')' AS Nom, CT_Adresse AS Adresse, CT_CodePostal AS CodePostal,
CT_ville AS Commune, CIP AS Code_CIP_Article, DL_Design AS Libelle_Produit, DL_QteBC AS Qte_Comm, DL_Qte AS Qte_Fact,
round(DL_Qte * DL_PrixUnitaire, 2) AS Mt_Brut_Facture, DL_PrixUnitaire AS Px_Unite_PHA, round(DL_Qte * DL_PrixRU, 2) AS Mt_en_PGHT,
DL_PrixRU AS Px_Unite_GRO, DL_Remise01REM_Valeur AS Tx_Remise, isnull(DL_Taxe1, 0) AS Code_TVA, TA_Intitule AS Libelle_TVA,
C.CT_NUM AS Num_Compte, E.Do_Piece, DL_Remise01REM_Valeur, FA_CodeFamille
FROM F_comptet C INNER JOIN
F_Docentete E ON E.DO_tiers = C.CT_num AND E.DO_domaine = 0 AND E.Do_type = 6 INNER JOIN
F_docligne L ON E.Do_piece = L.Do_piece AND E.Do_type = L.Do_type AND L.DL_Qte <> 0 AND DL_Taxe1 IS NOT NULL INNER JOIN
F_Article A ON L.AR_Ref = A.AR_Ref INNER JOIN
F_ArtFourniss AF ON AF.AR_Ref = A.AR_Ref AND AF.AF_Principal = 1 INNER JOIN
F_ArtCompta AC ON A.AR_Ref = AC.AR_Ref INNER JOIN
F_taxe T ON L.DL_Taxe1 = T .TA_taux AND T .TA_SENS = 1
WHERE T .TA_Code = AC.ACP_ComptaCpt_Taxe1 AND C.ct_type = 0 AND E.DO_date >= '01/04/2008' AND E.DO_date < '01/05/2008') V
GROUP BY Num_Compte, Tx_Remise, FA_CodeFamille
AS Mt_CA_Net_Facture
FROM (SELECT Idf_CIP AS Code_CIP_Officine, CT_intitule + '(' + CT_contact + ')' AS Nom, CT_Adresse AS Adresse, CT_CodePostal AS CodePostal,
CT_ville AS Commune, CIP AS Code_CIP_Article, DL_Design AS Libelle_Produit, DL_QteBC AS Qte_Comm, DL_Qte AS Qte_Fact,
round(DL_Qte * DL_PrixUnitaire, 2) AS Mt_Brut_Facture, DL_PrixUnitaire AS Px_Unite_PHA, round(DL_Qte * DL_PrixRU, 2) AS Mt_en_PGHT,
DL_PrixRU AS Px_Unite_GRO, DL_Remise01REM_Valeur AS Tx_Remise, isnull(DL_Taxe1, 0) AS Code_TVA, TA_Intitule AS Libelle_TVA,
C.CT_NUM AS Num_Compte, E.Do_Piece, DL_Remise01REM_Valeur, FA_CodeFamille
FROM F_comptet C INNER JOIN
F_Docentete E ON E.DO_tiers = C.CT_num AND E.DO_domaine = 0 AND E.Do_type = 6 INNER JOIN
F_docligne L ON E.Do_piece = L.Do_piece AND E.Do_type = L.Do_type AND L.DL_Qte <> 0 AND DL_Taxe1 IS NOT NULL INNER JOIN
F_Article A ON L.AR_Ref = A.AR_Ref INNER JOIN
F_ArtFourniss AF ON AF.AR_Ref = A.AR_Ref AND AF.AF_Principal = 1 INNER JOIN
F_ArtCompta AC ON A.AR_Ref = AC.AR_Ref INNER JOIN
F_taxe T ON L.DL_Taxe1 = T .TA_taux AND T .TA_SENS = 1
WHERE T .TA_Code = AC.ACP_ComptaCpt_Taxe1 AND C.ct_type = 0 AND E.DO_date >= '01/04/2008' AND E.DO_date < '01/05/2008') V
GROUP BY Num_Compte, Tx_Remise, FA_CodeFamille
Utilisateur anonyme
23 mai 2008 à 11:39
23 mai 2008 à 11:39
C illisible et incompréhensible ... :-(
Sh@tter
Messages postés
157
Date d'inscription
jeudi 29 novembre 2007
Statut
Membre
Dernière intervention
26 octobre 2009
46
>
Kaïembé
23 mai 2008 à 11:47
23 mai 2008 à 11:47
Tu devrais indenter ton code Kaïembé, ce sera déjà plus facile pour toi le relire quand tu viendras faire une modif dans plusieurs semaines et même pour ceux qui souhaitent t'aider à le modifier ^^
Utilisateur anonyme
23 mai 2008 à 11:57
23 mai 2008 à 11:57
tu devrais utiliser les balise code /code du forum pour garder l'indentation de ta requête.
SELECT NOM FROM TABLE_TEST WHERE ID_NOM = 'TEST'