From 226838d356055b72d63e61e3ace5e166cbde8eb8 Mon Sep 17 00:00:00 2001 From: Vincent Le Gallic Date: Sun, 5 Apr 2015 01:15:20 +0200 Subject: [PATCH] =?utf8?q?Mise=20=C3=A0=20jour=20des=20scripts=20de=20stat?= =?utf8?q?s=20de=20la=20bade=20bde=20vers=20la=20base=20note?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- bde/stats/consos.sh | 2 +- bde/stats/record.sh | 2 +- bde/stats/soldes.sh | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bde/stats/consos.sh b/bde/stats/consos.sh index cc130f4..bf11e17 100755 --- a/bde/stats/consos.sh +++ b/bde/stats/consos.sh @@ -3,4 +3,4 @@ # Affiche (par ordre décroissant d'occurrence) # le nombre de chaque conso effectuées par un comte -psql bde -c "SELECT remarque, SUM(quantite) AS qte FROM transactions WHERE $1 in (emetteur, destinataire) AND valide GROUP BY remarque ORDER BY qte DESC;" +psql note -c "SELECT description, SUM(quantite) AS qte FROM transactions WHERE $1 in (emetteur, destinataire) AND valide GROUP BY description ORDER BY qte DESC;" diff --git a/bde/stats/record.sh b/bde/stats/record.sh index ba9ed78..321f3b7 100755 --- a/bde/stats/record.sh +++ b/bde/stats/record.sh @@ -3,4 +3,4 @@ # Affiche par ordre décroissant les plus grand consommateur d'une conso # La comparaison est faite avec un ILIKE, on peut donc utiliser % et _ -psql bde -c "SELECT t.remarque, a.nom, a.prenom, a.pseudo, SUM(t.quantite) AS qte FROM transactions AS t, adherents AS a WHERE remarque ILIKE '$1' AND a.numcbde=t.emetteur AND valide GROUP BY t.remarque, a.nom, a.prenom, a.pseudo ORDER BY qte DESC;" +psql note -c "SELECT t.description, c.nom, c.prenom, c.pseudo, SUM(t.quantite) AS qte FROM transactions AS t, comptes AS c WHERE description ILIKE '$1' AND c.idbde=t.emetteur AND valide GROUP BY t.description, c.nom, c.prenom, c.pseudo ORDER BY qte DESC;" diff --git a/bde/stats/soldes.sh b/bde/stats/soldes.sh index 37d9a71..027056c 100755 --- a/bde/stats/soldes.sh +++ b/bde/stats/soldes.sh @@ -4,8 +4,8 @@ if [[ "$1" = "--no-club" ]] then - psql bde -c "SELECT nom, prenom, pseudo, solde FROM adherents WHERE NOT club ORDER BY solde DESC;" + psql note -c "SELECT nom, prenom, pseudo, solde FROM comptes WHERE type!='club' ORDER BY solde DESC;" else - psql bde -c "SELECT nom, prenom, pseudo, solde FROM adherents ORDER BY solde DESC;" + psql note -c "SELECT nom, prenom, pseudo, solde FROM comptes ORDER BY solde DESC;" fi -- 2.39.2