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
| LOCAL
sMaRequete est une chaîne
sdRQ1 est une Source de Données
sMaRequete = [
SELECT
SUM(CASE WHEN ( eleves.situat= 6 ) THEN 1 ELSE 0 END ) AS Q,
SUM(CASE WHEN ( eleves.situat= 5 ) THEN 1 ELSE 0 END ) AS A,
SUM(CASE WHEN ( eleves.situat= 4 ) THEN 1 ELSE 0 END ) AS N,
SUM(CASE WHEN ( eleves.situat= 3 ) THEN 1 ELSE 0 END ) AS C,
SUM(CASE WHEN ( eleves.situat = 2 ) THEN 1 ELSE 0 END ) AS I,
SUM(CASE WHEN ( eleves.situat= 1 ) THEN 1 ELSE 0 END ) AS V,
SUM(CASE WHEN ( eleves.situat = 0 ) THEN 1 ELSE 0 END ) AS E,
eleves.genre AS genre,
eleves.clas AS clas
FROM
eleves
WHERE
eleves.cdecol like '%1'
GROUP BY
eleves.genre,
eleves.clas
union
select
SUM(CASE WHEN ( eleves.situat= 6 ) THEN 1 ELSE 0 END ) AS Q,
SUM(CASE WHEN ( eleves.situat= 5 ) THEN 1 ELSE 0 END ) AS A,
SUM(CASE WHEN ( eleves.situat= 4 ) THEN 1 ELSE 0 END ) AS N,
SUM(CASE WHEN ( eleves.situat= 3 ) THEN 1 ELSE 0 END ) AS C,
SUM(CASE WHEN ( eleves.situat = 2 ) THEN 1 ELSE 0 END ) AS I,
SUM(CASE WHEN ( eleves.situat= 1 ) THEN 1 ELSE 0 END ) AS V,
SUM(CASE WHEN ( eleves.situat = 0 ) THEN 1 ELSE 0 END ) AS E
FROM
eleves
WHERE
eleves.cdecol like '%1'
ORDER BY
eleves.clas ,
eleves.genre
]
sMaRequete = ChaîneConstruit(sMaRequete,SAI_codeecole)
// exécution de la requête 1
SI PAS HExécuteRequêteSQL(sdRQ1,sMaRequete) ALORS Erreur(HErreurInfo); RETOUR
// rempli la table
ConstruitTableFichier(Table2,sdRQ1,taRemplirTable) |
Partager