{{:thematiques:informatique:ca_ttc_par_jours.png?400|}} SELECT sum("public"."report_pos_order"."price_total") AS "sum", (CAST(extract(dow from CAST("public"."report_pos_order"."date" AS timestamp)) AS integer) + 1) AS "jour", (date_trunc('week', CAST((CAST("public"."report_pos_order"."date" AS timestamp) + INTERVAL '1 day') AS timestamp)) - INTERVAL '1 day') AS "semaine" FROM "public"."report_pos_order" GROUP BY (CAST(extract(dow from CAST("public"."report_pos_order"."date" AS timestamp)) AS integer) + 1), (date_trunc('week', CAST((CAST("public"."report_pos_order"."date" AS timestamp) + INTERVAL '1 day') AS timestamp)) - INTERVAL '1 day') ORDER BY (CAST(extract(dow from CAST("public"."report_pos_order"."date" AS timestamp)) AS integer) + 1) ASC, (date_trunc('week', CAST((CAST("public"."report_pos_order"."date" AS timestamp) + INTERVAL '1 day') AS timestamp)) - INTERVAL '1 day') ASC