When I realize this type of SQLite SQL query:
SELECT SUM(Column) as TOTAL_DEBIT FROM table_name;
I expect the addition of real but it gives me sum of integer division of numbers.
For exemple:
SELECT SUM(DEBIT) as TOTAL_DEBIT FROM DEBIT
The SQL query on the table below gives that:
TOTAL_DEBIT
11475
I wish I get this kind of result:
TOTAL_DEBIT
11482,79
Example Table :
DROP TABLE IF EXISTS "DEBIT";
CREATE TABLE "DEBIT" ("DATE" DATETIME NOT NULL , "DEBIT" REAL NOT NULL );
INSERT INTO "DEBIT" VALUES('23/12/13','29,90');
INSERT INTO "DEBIT" VALUES('23/12/13','304,00');
INSERT INTO "DEBIT" VALUES('15/01/14','1245,48');
INSERT INTO "DEBIT" VALUES('21/01/14','304,00');
INSERT INTO "DEBIT" VALUES('23/01/14','30,00');
INSERT INTO "DEBIT" VALUES('28/01/14','129,10');
INSERT INTO "DEBIT" VALUES('31/01/14','32,10');
INSERT INTO "DEBIT" VALUES('21/02/14','30,00');
INSERT INTO "DEBIT" VALUES('21/02/14','304,00');
INSERT INTO "DEBIT" VALUES('17/03/14','117,66');
INSERT INTO "DEBIT" VALUES('21/03/14','30,00');
INSERT INTO "DEBIT" VALUES('21/03/14','304,00');
INSERT INTO "DEBIT" VALUES('02/04/14','175,62');
INSERT INTO "DEBIT" VALUES('22/04/14','304,00');
INSERT INTO "DEBIT" VALUES('23/04/14','30,00');
INSERT INTO "DEBIT" VALUES('30/04/14','32,10');
INSERT INTO "DEBIT" VALUES('21/05/14','304,00');
INSERT INTO "DEBIT" VALUES('22/05/14','2838,00');
INSERT INTO "DEBIT" VALUES('22/05/14','30,00');
INSERT INTO "DEBIT" VALUES('30/05/14','145,41');
INSERT INTO "DEBIT" VALUES('23/06/14','30,00');
INSERT INTO "DEBIT" VALUES('23/06/14','304,00');
INSERT INTO "DEBIT" VALUES('25/06/14','112,48');
INSERT INTO "DEBIT" VALUES('21/07/14','304,00');
INSERT INTO "DEBIT" VALUES('22/07/14','30,00');
INSERT INTO "DEBIT" VALUES('24/07/14','1245,48');
INSERT INTO "DEBIT" VALUES('25/07/14','127,68');
INSERT INTO "DEBIT" VALUES('31/07/14','32,10');
INSERT INTO "DEBIT" VALUES('12/08/14','23,89');
INSERT INTO "DEBIT" VALUES('21/08/14','30,00');
INSERT INTO "DEBIT" VALUES('21/08/14','304,00');
INSERT INTO "DEBIT" VALUES('10/09/14','480,00');
INSERT INTO "DEBIT" VALUES('22/09/14','30,00');
INSERT INTO "DEBIT" VALUES('22/09/14','304,00');
INSERT INTO "DEBIT" VALUES('29/09/14','131,37');
INSERT INTO "DEBIT" VALUES('21/10/14','30,00');
INSERT INTO "DEBIT" VALUES('21/10/14','304,00');
INSERT INTO "DEBIT" VALUES('24/10/14','96,00');
INSERT INTO "DEBIT" VALUES('31/10/14','32,50');
INSERT INTO "DEBIT" VALUES('21/11/14','304,00');
INSERT INTO "DEBIT" VALUES('24/11/14','30,00');
INSERT INTO "DEBIT" VALUES('28/11/14','143,92');
INSERT INTO "DEBIT" VALUES('22/12/14','30,00');
INSERT INTO "DEBIT" VALUES('22/12/14','304,00');
Thank you in advance for your help and best regards, Alban
Aucun commentaire:
Enregistrer un commentaire