From 6698cfaac70907dea8cfccf2167d3caad5b07bf7 Mon Sep 17 00:00:00 2001 From: Vincent Le Gallic Date: Wed, 4 Jan 2017 16:54:43 +0100 Subject: [PATCH] [bde] On peut maintenant fusionner Guinness et Guiness --- bde/stats/record.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bde/stats/record.sh b/bde/stats/record.sh index 321f3b7..241af84 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 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;" +psql note -c "SELECT string_agg(DISTINCT 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 c.nom, c.prenom, c.pseudo ORDER BY qte DESC;" -- 2.39.2