select LEFT("timeline".id,7) AS "timeline_year_month", SUM("orderfact".totalprice) AS "orderfact_totalprice", SUM("orderfact".quantityordered) AS "orderfact_quantityordered" from orderfact "orderfact", timeline "timeline" where "orderfact".time_id="timeline".id group by LEFT("timeline".id,7) order by "timeline_year_month", "orderfact_totalprice", "orderfact_quantityordered"