Commit f5d1c223 authored by Pierre-Elliott Bécue's avatar Pierre-Elliott Bécue

Ajout de la requête SQL utilisée pour pondre le csv note

parent edd9eb3a
#!/usr/bin/env python2.7
# -*- coding: utf-8; mode: python -*-
Requête SQL utilisée pour pondre le csv à parser :
COPY (SELECT, transactions.description,
transactions.type, transactions.emetteur, transactions.destinataire,
transactions.montant*transactions.quantite, emetteurs.nom,
emetteurs.prenom, destinataires.nom, destinataires.prenom as total
FROM transactions LEFT JOIN comptes AS emetteurs ON
transactions.emetteur = emetteurs.idbde LEFT JOIN comptes AS
destinataires ON transactions.destinataire = destinataires.idbde WHERE
valide=true AND (emetteur=2175 OR destinataire=2175) AND date BETWEEN
'2015-01-01 00:00:00' AND '2016-01-01 00:00:00' ORDER BY id DESC) TO
'/tmp/crans.csv' WITH CSV;
import csv
import argparse
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment