http://www.sql.ru/forum/1092772/neobhodimo-vychislit-maksimalnuu-summarnuu-prodazhu-za-neskolko-podryad-idushhih-dney