X-Git-Url: http://gitweb.pimeys.fr/?a=blobdiff_plain;f=bde%2Fintegrite%2Fmemo;fp=bde%2Fintegrite%2Fmemo;h=0000000000000000000000000000000000000000;hb=da1154aba10c5e77a8b40bc91de7c0b2cd616af7;hp=f7519c1c9ff550713ae7e910a90c03bb7a037abb;hpb=402f87153b7ac5a3a6c5e84e447e42edce1d76fb;p=scripts-20-100.git diff --git a/bde/integrite/memo b/bde/integrite/memo deleted file mode 100644 index f7519c1..0000000 --- a/bde/integrite/memo +++ /dev/null @@ -1,7 +0,0 @@ -# pour créer la table numcbde,gagne,perdu,effectif : - -SELECT numcbde,(SELECT sum(montant*quantite) FROM transactions WHERE destinataire=main.numcbde AND valide='t') as gagne,(SELECT sum(montant*quantite) FROM transactions WHERE emetteur=main.numcbde AND valide='t') as perdu, (SELECT solde FROM adherents WHERE numcbde=main.numcbde) as effectif FROM adherents as main; - -# et créer la table + en extraire seulement les gens intéressants : -# NB : c'est long à exécuter... -SELECT numcbde,gagne-perdu,effectif FROM (SELECT numcbde,(SELECT sum(montant*quantite) FROM transactions WHERE destinataire=main.numcbde AND valide='t') as gagne,(SELECT sum(montant*quantite) FROM transactions WHERE emetteur=main.numcbde AND valide='t') as perdu, (SELECT solde FROM adherents WHERE numcbde=main.numcbde) as effectif FROM adherents as main) AS calculs WHERE gagne-perdu!=effectif;