PostgreSQL La base de donnees la plus sophistiquee au monde.

Forums PostgreSQL.fr

Le forum officiel de la communauté francophone de PostgreSQL

Vous n'êtes pas identifié(e).

#1 PL/pgSQL » fonction qui calcule la moyenne des note d'une matière ????? » 24/07/2014 02:32:26

etoile88
Réponses : 0

voila ma requete sql :
SELECT etudiant.numetu, nom, prenom, libelle , coeff, notetd , notetp,noteexamen ,SUM((noteexamen*2)+notetd+notetp)/4  AS moymatiere
FROM notation, matiere, etudiant
WHERE notation.numepreuve = matiere.codemat
AND notation.numetu = etudiant.numetu
GROUP BY etudiant.numetu, nom, prenom, libelle , coeff,notetd,notetp,noteexamen
je cherche a  cree une fonction en plpgsql qui fait se calcule:   SUM((noteexamen*2)+notetd+notetp)/4 avec un parametre etudiant.numetu integer  ou plusier paramettre ????????

#2 PL/pgSQL » fonction qui calcule la moyenne des note pour des etudiant????? » 24/07/2014 02:13:41

etoile88
Réponses : 0

je cherche comment je peut cree une fonction pour ma requette en plpgsql et voila ma requette qui marche bien :
Moyenne generale de la matiere :

SELECT etudiant.numetu, nom, prenom, libelle , coeff, notetd , notetp,noteexamen,SUM((noteexamen*2)+notetd+notetp)/4  AS moymatiere
FROM notation, matiere, etudiant
WHERE notation.numepreuve = matiere.codemat
AND notation.numetu = etudiant.numetu
GROUP BY etudiant.numetu, nom, prenom, libelle , coeff,notetd,notetp,noteexamen

Pied de page des forums

Propulsé par FluxBB