Translations:Faq/Base/142/6/de

From The Document Foundation Wiki
Jump to navigation Jump to search

SELECT "a"."Kategorie",
(SELECT SUM("Betrag") FROM "Einkauf" WHERE "KategorieID" = "a"."ID" AND (EXTRACT(MONTH FROM "Datum") < EXTRACT(MONTH FROM CURRENT_DATE) OR EXTRACT(YEAR FROM "Datum") < EXTRACT(YEAR FROM CURRENT_DATE))) AS "Saldo Vormonat",
(SELECT SUM("Betrag") FROM "Einkauf" WHERE "KategorieID" = "a"."ID" AND (EXTRACT(MONTH FROM "Datum") = EXTRACT(MONTH FROM CURRENT_DATE) AND EXTRACT(YEAR FROM "Datum") = EXTRACT(YEAR FROM CURRENT_DATE))) AS "aktueller Monat",
(SELECT SUM("Betrag") FROM "Einkauf" WHERE "KategorieID" = "a"."ID") AS "Saldo" FROM "Kategorie" AS "a"